jaz-clio 5.36.14 → 5.36.16

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.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: jaz-api
3
- version: 5.36.14
3
+ version: 5.36.16
4
4
  description: >-
5
5
  Use this skill whenever you call, debug, or review code that touches the Jaz
6
6
  REST API. Covers field names, response shapes, 158 production gotchas, error
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: jaz-cli
3
- version: 5.36.14
3
+ version: 5.36.16
4
4
  description: >-
5
5
  Use this skill when running Clio CLI commands, building shell scripts with
6
6
  Clio, debugging auth issues, understanding --json output, paginating results,
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: jaz-conversion
3
- version: 5.36.14
3
+ version: 5.36.16
4
4
  description: >-
5
5
  Use this skill when migrating accounting data into Jaz — importing from Xero,
6
6
  QuickBooks, Sage, MYOB, or Excel exports. Covers the full conversion pipeline:
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: jaz-kit
3
- version: 5.36.14
3
+ version: 5.36.16
4
4
  description: >-
5
5
  Use this skill when an accountant, bookkeeper, or owner is running real books
6
6
  in Jaz across one or more organizations from the terminal — setting up a
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: jaz-pseudo-sql
3
- version: 5.36.14
3
+ version: 5.36.16
4
4
  description: >-
5
5
  Use this skill when answering ad-hoc data questions that aren't covered by
6
6
  download_export (canonical reports — anomaly, audit, aging, P&L, BS, GL,
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: jaz-jobs
3
- version: 5.36.14
3
+ version: 5.36.16
4
4
  description: >-
5
5
  Use this skill for recurring accounting workflows — month/quarter/year-end
6
6
  close, bank reconciliation, GST/VAT filing, payment runs, credit control,
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: jaz-recipes
3
- version: 5.36.14
3
+ version: 5.36.16
4
4
  description: >-
5
5
  Use this skill when modeling complex multi-step accounting transactions —
6
6
  anything that spans multiple periods, involves changing amounts, or requires
package/cli.mjs CHANGED
@@ -875,7 +875,7 @@ btType enum: SALE = invoice, PURCHASE = bill, SALE_CREDIT_NOTE = customer CN, PU
875
875
 
876
876
  Each result carries contactSignals (Mid-7: cadence, outliers, severity, divergences from contact's modal pattern; null if no contact / no history) and breakdown (Balance-panel payload: line items + subtotal/tax/total/balance/exchange rate). Top-level contactSignalsMeta.unavailable=true \u2192 freshness layer offline for whole batch.
877
877
 
878
- USE THIS to score a specific draft against contact history. For stand-alone "what does this contact normally look like?" without a draft \u2192 use get_contact_signals.`,params:{items:{type:"array",description:"Draft business transaction references (max 500). Mix any btType freely.",items:{type:"object",properties:{btResourceId:{type:"string",description:"Draft BT resource ID (UUID) \u2014 required"},btType:{type:"string",enum:["SALE","PURCHASE","SALE_CREDIT_NOTE","PURCHASE_CREDIT_NOTE"],description:"Required"}}}}},required:["items"],group:"drafts",readOnly:!0,isConcurrencySafe:!0,searchHint:"validate drafts eligibility check before convert promote",execute:async(t,e)=>(PI(e.items),y8(t.client,e.items))},{name:"convert_drafts_to_active",description:`BULK promote \u2014 finalize up to 500 draft business transactions to ACTIVE in ONE call, mixing any combination of invoices, bills, and credit notes (no per-type tools needed). ${Gl} NOT idempotent: a second call on already-promoted drafts returns 422. Filter the draft list by status: DRAFT before submitting. Pair with validate_drafts for a pre-flight check on large batches.`,params:{items:{type:"array",description:"Draft BT references (max 500). Mix any btType.",items:{type:"object",properties:{btResourceId:{type:"string",description:"Draft BT resource ID (UUID) \u2014 required"},btType:{type:"string",enum:["SALE","PURCHASE","SALE_CREDIT_NOTE","PURCHASE_CREDIT_NOTE"],description:"Required"}}}}},required:["items"],group:"drafts",readOnly:!1,searchHint:"convert drafts to active promote finalize bulk",execute:async(t,e)=>(PI(e.items),E8(t.client,e.items))},{name:"submit_drafts_for_approval",description:`BULK submit \u2014 route up to 500 draft business transactions into the approval workflow in ONE call, mixing any combination of invoices, bills, and credit notes. ${Gl} NOT idempotent on drafts that already have an in-flight approval request.`,params:{items:{type:"array",description:"Draft BT references (max 500). Mix any btType.",items:{type:"object",properties:{btResourceId:{type:"string",description:"Draft BT resource ID (UUID) \u2014 required"},btType:{type:"string",enum:["SALE","PURCHASE","SALE_CREDIT_NOTE","PURCHASE_CREDIT_NOTE"],description:"Required"}}}}},required:["items"],group:"drafts",readOnly:!1,searchHint:"submit drafts for approval workflow review bulk",execute:async(t,e)=>(PI(e.items),b8(t.client,e.items))},{name:"search_help_center",description:'Search the Jaz help center for how-to articles, feature guides, and accounting concepts. Use this for "how do I..." or "what is..." questions about Jaz: bank reconciliation, GST/VAT filing, multi-currency, fixed assets, custom fields, integrations, and so on. Returns top matching articles with title, section, content, and source URL.',params:{query:{type:"string",description:'Natural-language question or keywords (e.g. "how do I reconcile a bank statement", "set up GST", "multi-currency invoice").'},limit:{type:"number",description:"Maximum number of articles to return (default 3, max 10)."},section:{type:"string",description:'Optional: restrict to a single help-center section slug (e.g. "bank-reconciliations", "invoices").'}},required:["query"],group:"help_center",readOnly:!0,searchHint:"help center docs how to guide article search question",isConcurrencySafe:!0,maxResultSizeChars:2e4,execute:async(t,e)=>{let r=typeof e.limit=="number"?e.limit:void 0,n=typeof e.section=="string"?e.section:void 0;return ade(String(e.query??""),{limit:r,section:n})}},{name:"jot",description:"Record judgment entries in the org's judgment journal. THE RULE: log a judgment when you chose among real alternatives and a write followed, or when you deliberately decided NOT to write; skip mechanical actions and calls where the platform, the data, or the user left you no choice. Jot AFTER the write succeeds, never before, and carry the written record's resourceId in refs. Kinds: CLASSIFICATION account/tax/category choice \xB7 MATCH decided which records correspond \xB7 SCOPE chose what is in or out of a set \xB7 ASSUMPTION filled a gap the data left open \xB7 RISK proceeded despite a known concern \xB7 METHOD picked a calculation or approach \xB7 RECOVERY decided how to proceed after a failure (incl. holding a write) \xB7 DEVIATION knowingly departed from a stated rule. Accepting or rejecting an inbound external document (an e-invoice a counterparty sent) is a FINALIZE act, so pin it. A decided omission (you deliberately did not post something) is RECOVERY, which pins via withheld-write, not DEVIATION. Always give why: a call without a basis is half a record. Batch related entries in one call; each entry is acked independently. "+cP+" "+CLe,params:{entries:{type:"array",description:"Judgment entries to record (1-100). A bad entry never fails the batch: it acks with error while siblings persist.",items:{type:"object",properties:{kind:{type:"string",enum:["CLASSIFICATION","MATCH","SCOPE","ASSUMPTION","RISK","METHOD","RECOVERY","DEVIATION","NOTE"],description:"Judgment kind: one-liners in the tool description. "+sP},tier:{type:"string",enum:["LOW","MEDIUM","HIGH","CRITICAL"],description:"Severity you assign the call. "+iP},call:{type:"string",description:'The decision, one line (e.g. "Posted to 6420 Travel: recurring Grab vendor pattern").'},why:{type:"string",description:"The basis for the call: a call without a basis is half a record."},ruledOut:{type:"string",description:"Alternatives considered and set aside."},refs:{type:"array",description:"Entity refs this judgment touches. Include the written record's resourceId.",items:{type:"string",description:'Grammar TYPE:resourceId[#field][:RELATION], e.g. "INVOICE:41f6\u2026:CREATE". RELATION: CREATE UPDATE DELETE FINALIZE PAY RECONCILE TRIGGER SUBJECT INPUT REJECTED SUPERSEDES (default SUBJECT).'}},frame:{type:"string",description:'For set-shaped subjects: the defining query + counts (e.g. "search_bills status=UNPAID \xB7 41 in scope, 4 deferred").'},confidence:{type:"string",enum:["LOW","MEDIUM","HIGH"],description:"Routing hint for review attention. "+oP},citedRule:{type:"string",description:"Org rule, policy, threshold, or precedent applied."},workflowLabel:{type:"string",description:aP},agentLabel:{type:"string",description:"Self-reported product/model (e.g. jaz-clio/claude); informative, never authoritative."},idempotencyKey:{type:"string",description:"Retry key: a replay returns the existing entry, not a duplicate."}},required:["kind","tier","call"]}}},required:["entries"],group:"jots",readOnly:!1,alwaysLoaded:!0,searchHint:"jot judgment judgement journal record decision log rationale reasoning why chose ruled out classification match scope assumption risk method recovery deviation basis precedent note after write",execute:async(t,e)=>QI(t.client,e.entries)},{name:"recall",description:"Search the org's judgment journal (jots) for precedents, prior judgment calls with their basis. Check BEFORE repeating a judgment on the same entity, kind of decision, or workflow: a prior call with its why beats re-deriving from scratch; a FLAG or REJECT disposition on it is a warning, ENDORSE a strong precedent. Sort is pinned server-side (CRITICAL and withheld-write RECOVERY entries first, then newest). An empty page means no prior judgments match this filter, or none are recorded for this org yet.",params:{ref:{type:"string",description:'Entity ref filter, TYPE:resourceId (e.g. "INVOICE:41f626a3-\u2026").'},kind:{type:"string",enum:["CLASSIFICATION","MATCH","SCOPE","ASSUMPTION","RISK","METHOD","RECOVERY","DEVIATION","NOTE"],description:"Judgment kind filter."},tier:{type:"string",enum:["LOW","MEDIUM","HIGH","CRITICAL"],description:"Severity tier filter."},dispositionVerb:{type:"string",enum:["FLAG","REJECT","ENDORSE"],description:"Only entries carrying at least one disposition with this verb."},freetext:{type:"string",description:"Case-insensitive substring over call and why."},createdFrom:{type:"number",description:"Created-at lower bound, epoch ms (inclusive)."},createdTo:{type:"number",description:"Created-at upper bound, epoch ms (inclusive)."},firstParty:{type:"boolean",description:"true = only entries from Jaz-operated agent surfaces (server-stamped origin, never self-reported); false = only external and pre-stamp entries. Omit for all."},pinned:{type:"boolean",description:"true = only pinned entries (critical or withheld-write, the same predicate the pinned sort uses); false = only unpinned. Omit for all."},limit:{type:"number",description:"Max results per page (1-1000, default 100)."},offset:{type:"number",description:"Page number, 0-indexed."},includeStats:{type:"boolean",description:"Include per-credential disposition counts."}},required:[],group:"jots",readOnly:!0,isConcurrencySafe:!0,searchHint:"recall search jots judgment judgement journal precedent prior decisions rationale history dispositions flagged rejected endorsed first party jaz agents pinned lookup why",maxResultSizeChars:2e4,execute:async(t,e)=>{let r={};for(let n of["ref","kind","tier","dispositionVerb","freetext"])typeof e[n]=="string"&&e[n]&&(r[n]=e[n]);for(let n of["createdFrom","createdTo"])typeof e[n]=="number"&&(r[n]=e[n]);for(let n of["firstParty","pinned"])typeof e[n]=="boolean"&&(r[n]=e[n]);return rz(t.client,{...typeof e.limit=="number"?{limit:e.limit}:{},...typeof e.offset=="number"?{offset:e.offset}:{},...Object.keys(r).length?{filter:r}:{},...e.includeStats===!0?{includeStats:!0}:{}})}},{name:"remember",description:'Save, update, or remove a standing user preference (memory). MANDATORY: whenever the inbox owner states a lasting preference ("always\u2026", "never\u2026", "from now on\u2026"), call this tool with action "set" before finalizing your reply \u2014 even if the preference matches your current default behavior; a jot never substitutes for it. action "set" creates or updates the memory at (scope, category, key) \u2014 REUSE the exact key shown in the Saved preferences block when updating or reinforcing an existing entry; use replaces_key to supersede a different existing key; use confirms_key to confirm a pending candidate by its reference key. action "forget" removes one memory; "forget_all" removes ALL saved memories for this user. Setting key_type AND match_value makes the preference contextual (surfaced only on emails matching the sender address/domain, vendor name, or subject token); omit both for an always-on preference. category "autonomy-grant" is ALWAYS stored pending server-side and takes effect only after the user confirms. At most 3 memory writes per email turn. Returns {ok:true, outcome, resource_id} or {ok:false, reason} \u2014 NEVER tell the user a preference was saved unless the result has ok:true.',params:{action:{type:"string",enum:[...sit],description:'"set" to save/update, "forget" to remove one memory, "forget_all" to remove all.'},category:{type:"string",enum:[...oit],description:"Preference category the memory belongs to."},key:{type:"string",description:'Stable kebab-case identifier (max 120 chars), e.g. "acme-expense-account". Reuse keys shown in Saved preferences.'},directive:{type:"string",description:'The preference text to store (required for "set"; plain text, max 300 chars; no URLs, no email addresses \u2014 addresses belong in match_value; no markup or template syntax).'},scope:{type:"string",enum:[...ait],description:'"this_org" applies in this organization only (default); "all_orgs" follows the user across all their organizations.'},key_type:{type:"string",enum:[...cit],description:"What match_value matches on, for contextual preferences."},match_value:{type:"string",description:"The address/domain/name/token to match (required when key_type is set)."},replaces_key:{type:"string",description:"Existing key this memory supersedes, if any."},confirms_key:{type:"string",description:"Reference key of a pending candidate the user just confirmed, if any."},pending:{type:"boolean",description:"True to store as a candidate awaiting user confirmation instead of an active preference."},importance:{type:"number",description:"How much this changes your behavior, integer 0-100 (default 50). High (80+) for an autonomy grant or a posting-policy change that alters what gets booked; low (20 or below) for a wording or reply-style tweak."}},required:["action","category","key"],group:"memory",readOnly:!1,searchHint:"remember memory save user preference standing directive forget contextual sender vendor",channels:Ade()?["channel","chat"]:["channel"],alwaysLoaded:!0,disabled:!iz(),execute:async(t,e)=>lit(t,e)},{name:"present_questions",description:`Present the user with a bounded multiple-choice question (or a short sequence of them) as an interactive pick-list, instead of asking in prose. Use as your FINAL action when the user must choose among a KNOWN, finite set of options you ALREADY have from context (a prior search/list result, org defaults, or your own knowledge) to continue (e.g. "which bank account?", "which of these duplicate bills?"). Give 2-4 options per question \u2014 curate to the most likely, never dump a long list \u2014 and at most 4 questions; set multiSelect per question when more than one may apply. List the options and stop \u2014 the user's pick arrives as their next message and starts a new turn. Ask several questions at once when more than one thing is unspecified. Prose-ask only when there's no bounded set to offer (a free-text name or amount), to confirm destructive actions, or instead of fetching data just to populate options. Terminal: do not call further tools or re-list the options in text afterward.`,params:{questions:{type:"array",description:"Questions to ask, each rendered as one page of the pick-list (at most 4). Provide one unless you genuinely have several distinct choices to collect in sequence.",items:{type:"object",properties:{header:{type:"string",description:'Optional short eyebrow label categorizing the question (1-2 words, e.g. "Account", "Period").'},question:{type:"string",description:'The question, shown as the card title (e.g. "Which bank account should I inspect?").'},options:{type:"array",description:"2-4 concrete choices (hard cap \u2014 curate to the most likely; the user can still type a different answer if none fit).",items:{type:"object",properties:{label:{type:"string",description:"The choice shown on the row and relayed verbatim as the user's answer when picked \u2014 keep it self-contained and unambiguous."},description:{type:"string",description:'Optional one-line detail under the label (e.g. "554 unreconciled records").'}},required:["label"]}},multiSelect:{type:"boolean",description:"Set true to let the user select multiple options for this question; omit or false for a single pick."}},required:["question","options"]}}},required:["questions"],group:"interaction",alwaysLoaded:!0,interactive:!0,readOnly:!0,isConcurrencySafe:!0,searchHint:"present questions options choices pick select ask user interactive widget",maxResultSizeChars:2e4,execute:async(t,e)=>{let n=(Array.isArray(e?.questions)?e.questions:[]).filter(o=>typeof o=="object"&&o!==null).map(o=>{let s=(Array.isArray(o.options)?o.options:[]).filter(c=>typeof c=="object"&&c!==null).map(c=>{let u=String(c.label??"").trim();return c.description?{label:u,description:String(c.description)}:{label:u}}).filter(c=>c.label),a=String(o.question??"").trim();return{...o.header?{header:String(o.header)}:{},question:a,options:s,multiSelect:!!o.multiSelect}}).filter(o=>o.question&&o.options.length>=2);if(n.length===0)return{error:"present_questions needs at least one question with non-empty question text and \u22652 labeled options (a single-option pick-list is not a choice).",hint:"Provide questions: [{ question, options: [{ label }, { label }] }]. For open-ended input, ask in prose instead."};if(n.length>4)return{error:`present_questions renders at most 4 questions (got ${n.length}).`,hint:"Ask the 4 most important now; collect the rest on a later turn."};let i=n.find(o=>o.options.length>4);return i?{error:`Each question may offer at most 4 options ("${i.question}" has ${i.options.length}).`,hint:"Curate to the 4 most likely choices \u2014 the user can still type a different answer if none fit."}:{questions:n}}},{name:"describe_capabilities",description:"Offline. The capability map. No arguments: every namespace with its operation count. `namespace`: that namespace's operations with kinds and parameters. `query`: operations ranked by keyword. Call before telling a user something is unsupported, and to explain why your tool list is shorter than the operation count.",params:{namespace:{type:"string",description:'Drill into one namespace (e.g. "invoices") to list its operations and their parameters. Omit for the full map.'},query:{type:"string",description:'Rank operations across every namespace by keyword (e.g. "depreciation", "bank recon"). Omit for the full map.'}},required:[],group:"capabilities",readOnly:!0,isConcurrencySafe:!0,searchHint:"capabilities catalog overview inventory full list all operations how many operations namespaces map discover features supported unsupported",maxResultSizeChars:4e4,execute:async(t,e)=>{let{buildCapabilityMap:r}=await Promise.resolve().then(()=>(Hit(),Yit));return r({namespace:typeof e.namespace=="string"?e.namespace:void 0,query:typeof e.query=="string"?e.query:void 0,surface:t.mcpSurface})}},{name:"navigate",description:'Dashboard navigation: discover destinations, then build deep links. Without `destination`: lists valid destinations as { key, label, kind } \u2014 filter with `query` (substring over key + label), `resource` (e.g. "sales"), or `kind` ("screen" | "modal"); results are capped, narrow if `truncated`. With `destination`: builds the URL to hand the user \u2014 a screen (e.g. "reports.profit-and-loss") or a record modal (e.g. "sales.modal.view-sale"); pass `resourceId` only for a record-specific modal (view/edit one record), never for screens or create/"new" modals. Returns { url, kind, label }; the link opens in the user\'s current org. Never write dashboard URLs or destination keys from memory \u2014 call with no destination to discover keys first.',params:{destination:{type:"string",description:'Destination key to link to, e.g. "reports.profit-and-loss" or "sales.modal.view-sale". Omit to discover valid keys instead.'},resourceId:{type:"string",description:"Jaz resourceId of the record to focus \u2014 only with a record-modal destination (view/edit a specific record). Omit for screens and create modals."},query:{type:"string",description:'Discovery only: case-insensitive substring over destination keys and labels (e.g. "invoice", "p&l", "bank").'},resource:{type:"string",description:'Discovery only: restrict to one resource namespace, e.g. "sales", "purchases", "reports", "settings".'},kind:{type:"string",description:'Discovery only: restrict to "screen" (list/report pages) or "modal" (record view/create/edit).',enum:["screen","modal"]}},required:[],group:"navigation",alwaysLoaded:!0,readOnly:!0,isConcurrencySafe:!0,aliases:["find_dashboard_destinations","get_dashboard_url"],searchHint:"dashboard url deep link navigate go to open screen record modal page share shareable list destinations keys catalog",maxResultSizeChars:16e3,execute:async(t,e)=>{let r=typeof e.destination=="string"&&e.destination?e.destination:void 0,n=typeof e.resourceId=="string"&&e.resourceId?e.resourceId:void 0;if(!r){if(n)return{error:"resourceId given without destination - pass the record-modal destination key, or omit resourceId to discover destinations."};let o=e.kind==="screen"||e.kind==="modal"?e.kind:void 0,s=BLe({query:typeof e.query=="string"?e.query:void 0,resource:typeof e.resource=="string"?e.resource:void 0,kind:o});return s.truncated?{...s,hint:`Showing ${s.results.length} of ${s.total} matches. Narrow with a more specific query, resource, or kind.`}:s.results.length===0?{...s,hint:'No matches. Destinations are named by product area, not task wording \u2014 retry with a broader or synonym term (e.g. "billing" not "card", "sales" not "invoice payment", "settings", "reports", "bank") before concluding the destination does not exist.'}:s}let{dashboardUrl:i}=wLe(t.platform??"jaz");try{return xLe(r,n,{dashboardUrl:i,orgResourceId:t.org?.resourceId})}catch(o){return{error:o instanceof Error?o.message:String(o)}}}}];bLe(Rf)});function dot(){if(!zI){zI=new Map;for(let t of Rf)zI.set(t.name,t);for(let t of Rf)for(let e of t.aliases??[])zI.has(e)||zI.set(e,t)}return zI}function M8(t){return dot().get(t)}function kT(t,e){let r=dot().get(t);if(!(!r||r.disabled)&&!(r.channels!==void 0&&(e===void 0||!r.channels.includes(e))))return r}function NT(){return nfe||(nfe=Rf.filter(t=>!t.disabled&&t.channels===void 0)),nfe}function JIr(){return ife||(ife=NT().filter(t=>!t.interactive)),ife}function VIr(){return ofe||(ofe=Rf.filter(t=>!t.disabled&&t.channels!==void 0)),ofe}function qI(t){let e=t!==void 0&&GIr.has(t)?NT():JIr();if(t===void 0)return e;let r=VIr().filter(i=>i.channels.includes(t));if(r.length===0)return e;let n=uot.get(t);return n||(n=[...e,...r],uot.set(t,n)),n}function Jl(t){return NT().filter(e=>e.group===t)}var zI,nfe,GIr,ife,ofe,uot,td=X(()=>{"use strict";H8();zI=null,nfe=null;GIr=new Set(["chat"]),ife=null;ofe=null;uot=new Map});var lk=b(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.regexpCode=kr.getEsmExportName=kr.getProperty=kr.safeStringify=kr.stringify=kr.strConcat=kr.addCodeArg=kr.str=kr._=kr.nil=kr._Code=kr.Name=kr.IDENTIFIER=kr._CodeOrName=void 0;var ak=class{};kr._CodeOrName=ak;kr.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Qy=class extends ak{constructor(e){if(super(),!kr.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};kr.Name=Qy;var Kc=class extends ak{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Qy&&(r[n.str]=(r[n.str]||0)+1),r),{})}};kr._Code=Kc;kr.nil=new Kc("");function out(t,...e){let r=[t[0]],n=0;for(;n<e.length;)Dpe(r,e[n]),r.push(t[++n]);return new Kc(r)}kr._=out;var _pe=new Kc("+");function sut(t,...e){let r=[ck(t[0])],n=0;for(;n<e.length;)r.push(_pe),Dpe(r,e[n]),r.push(_pe,ck(t[++n]));return ODr(r),new Kc(r)}kr.str=sut;function Dpe(t,e){e instanceof Kc?t.push(...e._items):e instanceof Qy?t.push(e):t.push(LDr(e))}kr.addCodeArg=Dpe;function ODr(t){let e=1;for(;e<t.length-1;){if(t[e]===_pe){let r=FDr(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function FDr(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Qy||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Qy))return`"${t}${e.slice(1)}`}function QDr(t,e){return e.emptyStr()?t:t.emptyStr()?e:sut`${t}${e}`}kr.strConcat=QDr;function LDr(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:ck(Array.isArray(t)?t.join(","):t)}function MDr(t){return new Kc(ck(t))}kr.stringify=MDr;function ck(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}kr.safeStringify=ck;function PDr(t){return typeof t=="string"&&kr.IDENTIFIER.test(t)?new Kc(`.${t}`):out`[${t}]`}kr.getProperty=PDr;function UDr(t){if(typeof t=="string"&&kr.IDENTIFIER.test(t))return new Kc(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}kr.getEsmExportName=UDr;function $Dr(t){return new Kc(t.toString())}kr.regexpCode=$Dr});var xpe=b(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.ValueScope=Aa.ValueScopeName=Aa.Scope=Aa.varKinds=Aa.UsedValueState=void 0;var ma=lk(),Spe=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},k3;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(k3||(Aa.UsedValueState=k3={}));Aa.varKinds={const:new ma.Name("const"),let:new ma.Name("let"),var:new ma.Name("var")};var N3=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof ma.Name?e:this.name(e)}name(e){return new ma.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Aa.Scope=N3;var O3=class extends ma.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,ma._)`.${new ma.Name(r)}[${n}]`}};Aa.ValueScopeName=O3;var qDr=(0,ma._)`\n`,Rpe=class extends N3{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?qDr:ma.nil}}get(){return this._scope}name(e){return new O3(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:o}=i,s=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[o];if(a){let d=a.get(s);if(d)return d}else a=this._values[o]=new Map;a.set(s,i);let c=this._scope[o]||(this._scope[o]=[]),u=c.length;return c[u]=r.ref,i.setValue(r,{property:o,itemIndex:u}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,ma._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let o=ma.nil;for(let s in e){let a=e[s];if(!a)continue;let c=n[s]=n[s]||new Map;a.forEach(u=>{if(c.has(u))return;c.set(u,k3.Started);let d=r(u);if(d){let f=this.opts.es5?Aa.varKinds.var:Aa.varKinds.const;o=(0,ma._)`${o}${f} ${u} = ${d};${this.opts._n}`}else if(d=i?.(u))o=(0,ma._)`${o}${d}${this.opts._n}`;else throw new Spe(u);c.set(u,k3.Completed)})}return o}};Aa.ValueScope=Rpe});var Yt=b(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.or=zt.and=zt.not=zt.CodeGen=zt.operators=zt.varKinds=zt.ValueScopeName=zt.ValueScope=zt.Scope=zt.Name=zt.regexpCode=zt.stringify=zt.getProperty=zt.nil=zt.strConcat=zt.str=zt._=void 0;var mr=lk(),Xl=xpe(),bm=lk();Object.defineProperty(zt,"_",{enumerable:!0,get:function(){return bm._}});Object.defineProperty(zt,"str",{enumerable:!0,get:function(){return bm.str}});Object.defineProperty(zt,"strConcat",{enumerable:!0,get:function(){return bm.strConcat}});Object.defineProperty(zt,"nil",{enumerable:!0,get:function(){return bm.nil}});Object.defineProperty(zt,"getProperty",{enumerable:!0,get:function(){return bm.getProperty}});Object.defineProperty(zt,"stringify",{enumerable:!0,get:function(){return bm.stringify}});Object.defineProperty(zt,"regexpCode",{enumerable:!0,get:function(){return bm.regexpCode}});Object.defineProperty(zt,"Name",{enumerable:!0,get:function(){return bm.Name}});var M3=xpe();Object.defineProperty(zt,"Scope",{enumerable:!0,get:function(){return M3.Scope}});Object.defineProperty(zt,"ValueScope",{enumerable:!0,get:function(){return M3.ValueScope}});Object.defineProperty(zt,"ValueScopeName",{enumerable:!0,get:function(){return M3.ValueScopeName}});Object.defineProperty(zt,"varKinds",{enumerable:!0,get:function(){return M3.varKinds}});zt.operators={GT:new mr._Code(">"),GTE:new mr._Code(">="),LT:new mr._Code("<"),LTE:new mr._Code("<="),EQ:new mr._Code("==="),NEQ:new mr._Code("!=="),NOT:new mr._Code("!"),OR:new mr._Code("||"),AND:new mr._Code("&&"),ADD:new mr._Code("+")};var kf=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},Bpe=class extends kf{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Xl.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=r0(this.rhs,e,r)),this}get names(){return this.rhs instanceof mr._CodeOrName?this.rhs.names:{}}},F3=class extends kf{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof mr.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=r0(this.rhs,e,r),this}get names(){let e=this.lhs instanceof mr.Name?{}:{...this.lhs.names};return L3(e,this.rhs)}},Tpe=class extends F3{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},kpe=class extends kf{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Npe=class extends kf{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Ope=class extends kf{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Fpe=class extends kf{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=r0(this.code,e,r),this}get names(){return this.code instanceof mr._CodeOrName?this.code.names:{}}},uk=class extends kf{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let o=n[i];o.optimizeNames(e,r)||(jDr(e,o.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Py(e,r.names),{})}},Nf=class extends uk{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Qpe=class extends uk{},t0=class extends Nf{};t0.kind="else";var Ly=class t extends Nf{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new t0(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(aut(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=r0(this.condition,e,r),this}get names(){let e=super.names;return L3(e,this.condition),this.else&&Py(e,this.else.names),e}};Ly.kind="if";var My=class extends Nf{};My.kind="for";var Lpe=class extends My{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=r0(this.iteration,e,r),this}get names(){return Py(super.names,this.iteration.names)}},Mpe=class extends My{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?Xl.varKinds.var:this.varKind,{name:n,from:i,to:o}=this;return`for(${r} ${n}=${i}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=L3(super.names,this.from);return L3(e,this.to)}},Q3=class extends My{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=r0(this.iterable,e,r),this}get names(){return Py(super.names,this.iterable.names)}},dk=class extends Nf{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};dk.kind="func";var fk=class extends uk{render(e){return"return "+super.render(e)}};fk.kind="return";var Ppe=class extends Nf{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Py(e,this.catch.names),this.finally&&Py(e,this.finally.names),e}},pk=class extends Nf{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};pk.kind="catch";var hk=class extends Nf{render(e){return"finally"+super.render(e)}};hk.kind="finally";var Upe=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
878
+ USE THIS to score a specific draft against contact history. For stand-alone "what does this contact normally look like?" without a draft \u2192 use get_contact_signals.`,params:{items:{type:"array",description:"Draft business transaction references (max 500). Mix any btType freely.",items:{type:"object",properties:{btResourceId:{type:"string",description:"Draft BT resource ID (UUID) \u2014 required"},btType:{type:"string",enum:["SALE","PURCHASE","SALE_CREDIT_NOTE","PURCHASE_CREDIT_NOTE"],description:"Required"}}}}},required:["items"],group:"drafts",readOnly:!0,isConcurrencySafe:!0,searchHint:"validate drafts eligibility check before convert promote",execute:async(t,e)=>(PI(e.items),y8(t.client,e.items))},{name:"convert_drafts_to_active",description:`BULK promote \u2014 finalize up to 500 draft business transactions to ACTIVE in ONE call, mixing any combination of invoices, bills, and credit notes (no per-type tools needed). ${Gl} NOT idempotent: a second call on already-promoted drafts returns 422. Filter the draft list by status: DRAFT before submitting. Pair with validate_drafts for a pre-flight check on large batches.`,params:{items:{type:"array",description:"Draft BT references (max 500). Mix any btType.",items:{type:"object",properties:{btResourceId:{type:"string",description:"Draft BT resource ID (UUID) \u2014 required"},btType:{type:"string",enum:["SALE","PURCHASE","SALE_CREDIT_NOTE","PURCHASE_CREDIT_NOTE"],description:"Required"}}}}},required:["items"],group:"drafts",readOnly:!1,searchHint:"convert drafts to active promote finalize bulk",execute:async(t,e)=>(PI(e.items),E8(t.client,e.items))},{name:"submit_drafts_for_approval",description:`BULK submit \u2014 route up to 500 draft business transactions into the approval workflow in ONE call, mixing any combination of invoices, bills, and credit notes. ${Gl} NOT idempotent on drafts that already have an in-flight approval request.`,params:{items:{type:"array",description:"Draft BT references (max 500). Mix any btType.",items:{type:"object",properties:{btResourceId:{type:"string",description:"Draft BT resource ID (UUID) \u2014 required"},btType:{type:"string",enum:["SALE","PURCHASE","SALE_CREDIT_NOTE","PURCHASE_CREDIT_NOTE"],description:"Required"}}}}},required:["items"],group:"drafts",readOnly:!1,searchHint:"submit drafts for approval workflow review bulk",execute:async(t,e)=>(PI(e.items),b8(t.client,e.items))},{name:"search_help_center",description:'Search the Jaz help center for how-to articles, feature guides, and accounting concepts. Use this for "how do I..." or "what is..." questions about Jaz: bank reconciliation, GST/VAT filing, multi-currency, fixed assets, custom fields, integrations, and so on. Returns top matching articles with title, section, content, and source URL.',params:{query:{type:"string",description:'Natural-language question or keywords (e.g. "how do I reconcile a bank statement", "set up GST", "multi-currency invoice").'},limit:{type:"number",description:"Maximum number of articles to return (default 3, max 10)."},section:{type:"string",description:'Optional: restrict to a single help-center section slug (e.g. "bank-reconciliations", "invoices").'}},required:["query"],group:"help_center",readOnly:!0,searchHint:"help center docs how to guide article search question",isConcurrencySafe:!0,maxResultSizeChars:2e4,execute:async(t,e)=>{let r=typeof e.limit=="number"?e.limit:void 0,n=typeof e.section=="string"?e.section:void 0;return ade(String(e.query??""),{limit:r,section:n})}},{name:"jot",description:"Record judgment entries in the org's judgment journal. THE RULE: log a judgment when you chose among real alternatives and a write followed, or when you deliberately decided NOT to write; skip mechanical actions and calls where the platform, the data, or the user left you no choice. Jot AFTER the write succeeds, never before, and carry the written record's resourceId in refs. Kinds: CLASSIFICATION account/tax/category choice \xB7 MATCH decided which records correspond \xB7 SCOPE chose what is in or out of a set \xB7 ASSUMPTION filled a gap the data left open \xB7 RISK proceeded despite a known concern \xB7 METHOD picked a calculation or approach \xB7 RECOVERY decided how to proceed after a failure (incl. holding a write) \xB7 DEVIATION knowingly departed from a stated rule. Accepting or rejecting an inbound external document (an e-invoice a counterparty sent) is a FINALIZE act, so pin it. A decided omission (you deliberately did not post something) is RECOVERY, which pins via withheld-write, not DEVIATION. Always give why: a call without a basis is half a record. Batch related entries in one call; each entry is acked independently. "+cP+" "+CLe,params:{entries:{type:"array",description:"Judgment entries to record (1-100). A bad entry never fails the batch: it acks with error while siblings persist.",items:{type:"object",properties:{kind:{type:"string",enum:["CLASSIFICATION","MATCH","SCOPE","ASSUMPTION","RISK","METHOD","RECOVERY","DEVIATION","NOTE"],description:"Judgment kind: one-liners in the tool description. "+sP},tier:{type:"string",enum:["LOW","MEDIUM","HIGH","CRITICAL"],description:"Severity you assign the call. "+iP},call:{type:"string",description:'The decision, one line (e.g. "Posted to 6420 Travel: recurring Grab vendor pattern").'},why:{type:"string",description:"The basis for the call: a call without a basis is half a record."},ruledOut:{type:"string",description:"Alternatives considered and set aside."},refs:{type:"array",description:"Entity refs this judgment touches. Include the written record's resourceId.",items:{type:"string",description:'Grammar TYPE:resourceId[#field][:RELATION], e.g. "INVOICE:41f6\u2026:CREATE". RELATION: CREATE UPDATE DELETE FINALIZE PAY RECONCILE TRIGGER SUBJECT INPUT REJECTED SUPERSEDES (default SUBJECT).'}},frame:{type:"string",description:'For set-shaped subjects: the defining query + counts (e.g. "search_bills status=UNPAID \xB7 41 in scope, 4 deferred").'},confidence:{type:"string",enum:["LOW","MEDIUM","HIGH"],description:"Routing hint for review attention. "+oP},citedRule:{type:"string",description:"Org rule, policy, threshold, or precedent applied."},workflowLabel:{type:"string",description:aP},agentLabel:{type:"string",description:"Self-reported product/model (e.g. jaz-clio/claude); informative, never authoritative."},idempotencyKey:{type:"string",description:"Retry key: a replay returns the existing entry, not a duplicate."}},required:["kind","tier","call"]}}},required:["entries"],group:"jots",readOnly:!1,alwaysLoaded:!0,searchHint:"jot judgment judgement journal record decision log rationale reasoning why chose ruled out classification match scope assumption risk method recovery deviation basis precedent note after write",execute:async(t,e)=>QI(t.client,e.entries)},{name:"recall",description:"Search the org's judgment journal (jots) for precedents, prior judgment calls with their basis. Check BEFORE repeating a judgment on the same entity, kind of decision, or workflow: a prior call with its why beats re-deriving from scratch; a FLAG or REJECT disposition on it is a warning, ENDORSE a strong precedent. Sort is pinned server-side (CRITICAL and withheld-write RECOVERY entries first, then newest). An empty page means no prior judgments match this filter, or none are recorded for this org yet.",params:{ref:{type:"string",description:'Entity ref filter, TYPE:resourceId (e.g. "INVOICE:41f626a3-\u2026").'},kind:{type:"string",enum:["CLASSIFICATION","MATCH","SCOPE","ASSUMPTION","RISK","METHOD","RECOVERY","DEVIATION","NOTE"],description:"Judgment kind filter."},tier:{type:"string",enum:["LOW","MEDIUM","HIGH","CRITICAL"],description:"Severity tier filter."},dispositionVerb:{type:"string",enum:["FLAG","REJECT","ENDORSE"],description:"Only entries carrying at least one disposition with this verb."},freetext:{type:"string",description:"Case-insensitive substring over call and why."},createdFrom:{type:"number",description:"Created-at lower bound, epoch ms (inclusive)."},createdTo:{type:"number",description:"Created-at upper bound, epoch ms (inclusive)."},firstParty:{type:"boolean",description:"true = only entries from Jaz-operated agent surfaces (server-stamped origin, never self-reported); false = only external and pre-stamp entries. Omit for all."},pinned:{type:"boolean",description:"true = only pinned entries (critical or withheld-write, the same predicate the pinned sort uses); false = only unpinned. Omit for all."},limit:{type:"number",description:"Max results per page (1-1000, default 100)."},offset:{type:"number",description:"Page number, 0-indexed."},includeStats:{type:"boolean",description:"Include per-credential disposition counts."}},required:[],group:"jots",readOnly:!0,isConcurrencySafe:!0,searchHint:"recall search jots judgment judgement journal precedent prior decisions rationale history dispositions flagged rejected endorsed first party jaz agents pinned lookup why",maxResultSizeChars:2e4,execute:async(t,e)=>{let r={};for(let n of["ref","kind","tier","dispositionVerb","freetext"])typeof e[n]=="string"&&e[n]&&(r[n]=e[n]);for(let n of["createdFrom","createdTo"])typeof e[n]=="number"&&(r[n]=e[n]);for(let n of["firstParty","pinned"])typeof e[n]=="boolean"&&(r[n]=e[n]);return rz(t.client,{...typeof e.limit=="number"?{limit:e.limit}:{},...typeof e.offset=="number"?{offset:e.offset}:{},...Object.keys(r).length?{filter:r}:{},...e.includeStats===!0?{includeStats:!0}:{}})}},{name:"remember",description:'Save, update, or remove a standing user preference (memory). MANDATORY: whenever the user states a lasting preference ("always\u2026", "never\u2026", "from now on\u2026"), call this tool with action "set" before finalizing your reply \u2014 even if the preference matches your current default behavior; a jot never substitutes for it. action "set" creates or updates the memory at (scope, category, key) \u2014 REUSE the exact key shown in the Saved preferences block when updating or reinforcing an existing entry; use replaces_key to supersede a different existing key; use confirms_key to confirm a pending candidate by its reference key. action "forget" removes one memory; "forget_all" removes ALL saved memories for this user. Setting key_type AND match_value makes the preference contextual (matched by vendor name, subject token, or \u2014 email only \u2014 sender address/domain); omit both for always-on. category "autonomy-grant" is ALWAYS stored pending server-side and takes effect only after the user confirms. At most 3 memory writes per turn. Returns {ok:true, outcome, resource_id} or {ok:false, reason} \u2014 NEVER tell the user a preference was saved unless the result has ok:true.',params:{action:{type:"string",enum:[...sit],description:'"set" to save/update, "forget" to remove one memory, "forget_all" to remove all.'},category:{type:"string",enum:[...oit],description:"Preference category the memory belongs to."},key:{type:"string",description:'Stable kebab-case identifier (max 120 chars), e.g. "acme-expense-account". Reuse keys shown in Saved preferences.'},directive:{type:"string",description:'The preference text to store (required for "set"; plain text, max 300 chars; no URLs, no email addresses \u2014 addresses belong in match_value; no markup or template syntax).'},scope:{type:"string",enum:[...ait],description:'"this_org" applies in this organization only (default); "all_orgs" follows the user across all their organizations.'},key_type:{type:"string",enum:[...cit],description:"What match_value matches on, for contextual preferences."},match_value:{type:"string",description:"The address/domain/name/token to match (required when key_type is set)."},replaces_key:{type:"string",description:"Existing key this memory supersedes, if any."},confirms_key:{type:"string",description:"Reference key of a pending candidate the user just confirmed, if any."},pending:{type:"boolean",description:"True to store as a candidate awaiting user confirmation instead of an active preference."},importance:{type:"number",description:"How much this changes your behavior, integer 0-100 (default 50). High (80+) for an autonomy grant or a posting-policy change that alters what gets booked; low (20 or below) for a wording or reply-style tweak."}},required:["action","category","key"],group:"memory",readOnly:!1,searchHint:"remember memory save user preference standing directive forget contextual sender vendor",channels:Ade()?["channel","chat"]:["channel"],alwaysLoaded:!0,disabled:!iz(),execute:async(t,e)=>lit(t,e)},{name:"present_questions",description:`Present the user with a bounded multiple-choice question (or a short sequence of them) as an interactive pick-list, instead of asking in prose. Use as your FINAL action when the user must choose among a KNOWN, finite set of options you ALREADY have from context (a prior search/list result, org defaults, or your own knowledge) to continue (e.g. "which bank account?", "which of these duplicate bills?"). Give 2-4 options per question \u2014 curate to the most likely, never dump a long list \u2014 and at most 4 questions; set multiSelect per question when more than one may apply. List the options and stop \u2014 the user's pick arrives as their next message and starts a new turn. Ask several questions at once when more than one thing is unspecified. Prose-ask only when there's no bounded set to offer (a free-text name or amount), to confirm destructive actions, or instead of fetching data just to populate options. Terminal: do not call further tools or re-list the options in text afterward.`,params:{questions:{type:"array",description:"Questions to ask, each rendered as one page of the pick-list (at most 4). Provide one unless you genuinely have several distinct choices to collect in sequence.",items:{type:"object",properties:{header:{type:"string",description:'Optional short eyebrow label categorizing the question (1-2 words, e.g. "Account", "Period").'},question:{type:"string",description:'The question, shown as the card title (e.g. "Which bank account should I inspect?").'},options:{type:"array",description:"2-4 concrete choices (hard cap \u2014 curate to the most likely; the user can still type a different answer if none fit).",items:{type:"object",properties:{label:{type:"string",description:"The choice shown on the row and relayed verbatim as the user's answer when picked \u2014 keep it self-contained and unambiguous."},description:{type:"string",description:'Optional one-line detail under the label (e.g. "554 unreconciled records").'}},required:["label"]}},multiSelect:{type:"boolean",description:"Set true to let the user select multiple options for this question; omit or false for a single pick."}},required:["question","options"]}}},required:["questions"],group:"interaction",alwaysLoaded:!0,interactive:!0,readOnly:!0,isConcurrencySafe:!0,searchHint:"present questions options choices pick select ask user interactive widget",maxResultSizeChars:2e4,execute:async(t,e)=>{let n=(Array.isArray(e?.questions)?e.questions:[]).filter(o=>typeof o=="object"&&o!==null).map(o=>{let s=(Array.isArray(o.options)?o.options:[]).filter(c=>typeof c=="object"&&c!==null).map(c=>{let u=String(c.label??"").trim();return c.description?{label:u,description:String(c.description)}:{label:u}}).filter(c=>c.label),a=String(o.question??"").trim();return{...o.header?{header:String(o.header)}:{},question:a,options:s,multiSelect:!!o.multiSelect}}).filter(o=>o.question&&o.options.length>=2);if(n.length===0)return{error:"present_questions needs at least one question with non-empty question text and \u22652 labeled options (a single-option pick-list is not a choice).",hint:"Provide questions: [{ question, options: [{ label }, { label }] }]. For open-ended input, ask in prose instead."};if(n.length>4)return{error:`present_questions renders at most 4 questions (got ${n.length}).`,hint:"Ask the 4 most important now; collect the rest on a later turn."};let i=n.find(o=>o.options.length>4);return i?{error:`Each question may offer at most 4 options ("${i.question}" has ${i.options.length}).`,hint:"Curate to the 4 most likely choices \u2014 the user can still type a different answer if none fit."}:{questions:n}}},{name:"describe_capabilities",description:"Offline. The capability map. No arguments: every namespace with its operation count. `namespace`: that namespace's operations with kinds and parameters. `query`: operations ranked by keyword. Call before telling a user something is unsupported, and to explain why your tool list is shorter than the operation count.",params:{namespace:{type:"string",description:'Drill into one namespace (e.g. "invoices") to list its operations and their parameters. Omit for the full map.'},query:{type:"string",description:'Rank operations across every namespace by keyword (e.g. "depreciation", "bank recon"). Omit for the full map.'}},required:[],group:"capabilities",readOnly:!0,isConcurrencySafe:!0,searchHint:"capabilities catalog overview inventory full list all operations how many operations namespaces map discover features supported unsupported",maxResultSizeChars:4e4,execute:async(t,e)=>{let{buildCapabilityMap:r}=await Promise.resolve().then(()=>(Hit(),Yit));return r({namespace:typeof e.namespace=="string"?e.namespace:void 0,query:typeof e.query=="string"?e.query:void 0,surface:t.mcpSurface})}},{name:"navigate",description:'Dashboard navigation: discover destinations, then build deep links. Without `destination`: lists valid destinations as { key, label, kind } \u2014 filter with `query` (substring over key + label), `resource` (e.g. "sales"), or `kind` ("screen" | "modal"); results are capped, narrow if `truncated`. With `destination`: builds the URL to hand the user \u2014 a screen (e.g. "reports.profit-and-loss") or a record modal (e.g. "sales.modal.view-sale"); pass `resourceId` only for a record-specific modal (view/edit one record), never for screens or create/"new" modals. Returns { url, kind, label }; the link opens in the user\'s current org. Never write dashboard URLs or destination keys from memory \u2014 call with no destination to discover keys first.',params:{destination:{type:"string",description:'Destination key to link to, e.g. "reports.profit-and-loss" or "sales.modal.view-sale". Omit to discover valid keys instead.'},resourceId:{type:"string",description:"Jaz resourceId of the record to focus \u2014 only with a record-modal destination (view/edit a specific record). Omit for screens and create modals."},query:{type:"string",description:'Discovery only: case-insensitive substring over destination keys and labels (e.g. "invoice", "p&l", "bank").'},resource:{type:"string",description:'Discovery only: restrict to one resource namespace, e.g. "sales", "purchases", "reports", "settings".'},kind:{type:"string",description:'Discovery only: restrict to "screen" (list/report pages) or "modal" (record view/create/edit).',enum:["screen","modal"]}},required:[],group:"navigation",alwaysLoaded:!0,readOnly:!0,isConcurrencySafe:!0,aliases:["find_dashboard_destinations","get_dashboard_url"],searchHint:"dashboard url deep link navigate go to open screen record modal page share shareable list destinations keys catalog",maxResultSizeChars:16e3,execute:async(t,e)=>{let r=typeof e.destination=="string"&&e.destination?e.destination:void 0,n=typeof e.resourceId=="string"&&e.resourceId?e.resourceId:void 0;if(!r){if(n)return{error:"resourceId given without destination - pass the record-modal destination key, or omit resourceId to discover destinations."};let o=e.kind==="screen"||e.kind==="modal"?e.kind:void 0,s=BLe({query:typeof e.query=="string"?e.query:void 0,resource:typeof e.resource=="string"?e.resource:void 0,kind:o});return s.truncated?{...s,hint:`Showing ${s.results.length} of ${s.total} matches. Narrow with a more specific query, resource, or kind.`}:s.results.length===0?{...s,hint:'No matches. Destinations are named by product area, not task wording \u2014 retry with a broader or synonym term (e.g. "billing" not "card", "sales" not "invoice payment", "settings", "reports", "bank") before concluding the destination does not exist.'}:s}let{dashboardUrl:i}=wLe(t.platform??"jaz");try{return xLe(r,n,{dashboardUrl:i,orgResourceId:t.org?.resourceId})}catch(o){return{error:o instanceof Error?o.message:String(o)}}}}];bLe(Rf)});function dot(){if(!zI){zI=new Map;for(let t of Rf)zI.set(t.name,t);for(let t of Rf)for(let e of t.aliases??[])zI.has(e)||zI.set(e,t)}return zI}function M8(t){return dot().get(t)}function kT(t,e){let r=dot().get(t);if(!(!r||r.disabled)&&!(r.channels!==void 0&&(e===void 0||!r.channels.includes(e))))return r}function NT(){return nfe||(nfe=Rf.filter(t=>!t.disabled&&t.channels===void 0)),nfe}function JIr(){return ife||(ife=NT().filter(t=>!t.interactive)),ife}function VIr(){return ofe||(ofe=Rf.filter(t=>!t.disabled&&t.channels!==void 0)),ofe}function qI(t){let e=t!==void 0&&GIr.has(t)?NT():JIr();if(t===void 0)return e;let r=VIr().filter(i=>i.channels.includes(t));if(r.length===0)return e;let n=uot.get(t);return n||(n=[...e,...r],uot.set(t,n)),n}function Jl(t){return NT().filter(e=>e.group===t)}var zI,nfe,GIr,ife,ofe,uot,td=X(()=>{"use strict";H8();zI=null,nfe=null;GIr=new Set(["chat"]),ife=null;ofe=null;uot=new Map});var lk=b(kr=>{"use strict";Object.defineProperty(kr,"__esModule",{value:!0});kr.regexpCode=kr.getEsmExportName=kr.getProperty=kr.safeStringify=kr.stringify=kr.strConcat=kr.addCodeArg=kr.str=kr._=kr.nil=kr._Code=kr.Name=kr.IDENTIFIER=kr._CodeOrName=void 0;var ak=class{};kr._CodeOrName=ak;kr.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Qy=class extends ak{constructor(e){if(super(),!kr.IDENTIFIER.test(e))throw new Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};kr.Name=Qy;var Kc=class extends ak{constructor(e){super(),this._items=typeof e=="string"?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return e===""||e==='""'}get str(){var e;return(e=this._str)!==null&&e!==void 0?e:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var e;return(e=this._names)!==null&&e!==void 0?e:this._names=this._items.reduce((r,n)=>(n instanceof Qy&&(r[n.str]=(r[n.str]||0)+1),r),{})}};kr._Code=Kc;kr.nil=new Kc("");function out(t,...e){let r=[t[0]],n=0;for(;n<e.length;)Dpe(r,e[n]),r.push(t[++n]);return new Kc(r)}kr._=out;var _pe=new Kc("+");function sut(t,...e){let r=[ck(t[0])],n=0;for(;n<e.length;)r.push(_pe),Dpe(r,e[n]),r.push(_pe,ck(t[++n]));return ODr(r),new Kc(r)}kr.str=sut;function Dpe(t,e){e instanceof Kc?t.push(...e._items):e instanceof Qy?t.push(e):t.push(LDr(e))}kr.addCodeArg=Dpe;function ODr(t){let e=1;for(;e<t.length-1;){if(t[e]===_pe){let r=FDr(t[e-1],t[e+1]);if(r!==void 0){t.splice(e-1,3,r);continue}t[e++]="+"}e++}}function FDr(t,e){if(e==='""')return t;if(t==='""')return e;if(typeof t=="string")return e instanceof Qy||t[t.length-1]!=='"'?void 0:typeof e!="string"?`${t.slice(0,-1)}${e}"`:e[0]==='"'?t.slice(0,-1)+e.slice(1):void 0;if(typeof e=="string"&&e[0]==='"'&&!(t instanceof Qy))return`"${t}${e.slice(1)}`}function QDr(t,e){return e.emptyStr()?t:t.emptyStr()?e:sut`${t}${e}`}kr.strConcat=QDr;function LDr(t){return typeof t=="number"||typeof t=="boolean"||t===null?t:ck(Array.isArray(t)?t.join(","):t)}function MDr(t){return new Kc(ck(t))}kr.stringify=MDr;function ck(t){return JSON.stringify(t).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}kr.safeStringify=ck;function PDr(t){return typeof t=="string"&&kr.IDENTIFIER.test(t)?new Kc(`.${t}`):out`[${t}]`}kr.getProperty=PDr;function UDr(t){if(typeof t=="string"&&kr.IDENTIFIER.test(t))return new Kc(`${t}`);throw new Error(`CodeGen: invalid export name: ${t}, use explicit $id name mapping`)}kr.getEsmExportName=UDr;function $Dr(t){return new Kc(t.toString())}kr.regexpCode=$Dr});var xpe=b(Aa=>{"use strict";Object.defineProperty(Aa,"__esModule",{value:!0});Aa.ValueScope=Aa.ValueScopeName=Aa.Scope=Aa.varKinds=Aa.UsedValueState=void 0;var ma=lk(),Spe=class extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}},k3;(function(t){t[t.Started=0]="Started",t[t.Completed=1]="Completed"})(k3||(Aa.UsedValueState=k3={}));Aa.varKinds={const:new ma.Name("const"),let:new ma.Name("let"),var:new ma.Name("var")};var N3=class{constructor({prefixes:e,parent:r}={}){this._names={},this._prefixes=e,this._parent=r}toName(e){return e instanceof ma.Name?e:this.name(e)}name(e){return new ma.Name(this._newName(e))}_newName(e){let r=this._names[e]||this._nameGroup(e);return`${e}${r.index++}`}_nameGroup(e){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(e)||this._prefixes&&!this._prefixes.has(e))throw new Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}};Aa.Scope=N3;var O3=class extends ma.Name{constructor(e,r){super(r),this.prefix=e}setValue(e,{property:r,itemIndex:n}){this.value=e,this.scopePath=(0,ma._)`.${new ma.Name(r)}[${n}]`}};Aa.ValueScopeName=O3;var qDr=(0,ma._)`\n`,Rpe=class extends N3{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?qDr:ma.nil}}get(){return this._scope}name(e){return new O3(e,this._newName(e))}value(e,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let i=this.toName(e),{prefix:o}=i,s=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[o];if(a){let d=a.get(s);if(d)return d}else a=this._values[o]=new Map;a.set(s,i);let c=this._scope[o]||(this._scope[o]=[]),u=c.length;return c[u]=r.ref,i.setValue(r,{property:o,itemIndex:u}),i}getValue(e,r){let n=this._values[e];if(n)return n.get(r)}scopeRefs(e,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,ma._)`${e}${n.scopePath}`})}scopeCode(e=this._values,r,n){return this._reduceValues(e,i=>{if(i.value===void 0)throw new Error(`CodeGen: name "${i}" has no value`);return i.value.code},r,n)}_reduceValues(e,r,n={},i){let o=ma.nil;for(let s in e){let a=e[s];if(!a)continue;let c=n[s]=n[s]||new Map;a.forEach(u=>{if(c.has(u))return;c.set(u,k3.Started);let d=r(u);if(d){let f=this.opts.es5?Aa.varKinds.var:Aa.varKinds.const;o=(0,ma._)`${o}${f} ${u} = ${d};${this.opts._n}`}else if(d=i?.(u))o=(0,ma._)`${o}${d}${this.opts._n}`;else throw new Spe(u);c.set(u,k3.Completed)})}return o}};Aa.ValueScope=Rpe});var Yt=b(zt=>{"use strict";Object.defineProperty(zt,"__esModule",{value:!0});zt.or=zt.and=zt.not=zt.CodeGen=zt.operators=zt.varKinds=zt.ValueScopeName=zt.ValueScope=zt.Scope=zt.Name=zt.regexpCode=zt.stringify=zt.getProperty=zt.nil=zt.strConcat=zt.str=zt._=void 0;var mr=lk(),Xl=xpe(),bm=lk();Object.defineProperty(zt,"_",{enumerable:!0,get:function(){return bm._}});Object.defineProperty(zt,"str",{enumerable:!0,get:function(){return bm.str}});Object.defineProperty(zt,"strConcat",{enumerable:!0,get:function(){return bm.strConcat}});Object.defineProperty(zt,"nil",{enumerable:!0,get:function(){return bm.nil}});Object.defineProperty(zt,"getProperty",{enumerable:!0,get:function(){return bm.getProperty}});Object.defineProperty(zt,"stringify",{enumerable:!0,get:function(){return bm.stringify}});Object.defineProperty(zt,"regexpCode",{enumerable:!0,get:function(){return bm.regexpCode}});Object.defineProperty(zt,"Name",{enumerable:!0,get:function(){return bm.Name}});var M3=xpe();Object.defineProperty(zt,"Scope",{enumerable:!0,get:function(){return M3.Scope}});Object.defineProperty(zt,"ValueScope",{enumerable:!0,get:function(){return M3.ValueScope}});Object.defineProperty(zt,"ValueScopeName",{enumerable:!0,get:function(){return M3.ValueScopeName}});Object.defineProperty(zt,"varKinds",{enumerable:!0,get:function(){return M3.varKinds}});zt.operators={GT:new mr._Code(">"),GTE:new mr._Code(">="),LT:new mr._Code("<"),LTE:new mr._Code("<="),EQ:new mr._Code("==="),NEQ:new mr._Code("!=="),NOT:new mr._Code("!"),OR:new mr._Code("||"),AND:new mr._Code("&&"),ADD:new mr._Code("+")};var kf=class{optimizeNodes(){return this}optimizeNames(e,r){return this}},Bpe=class extends kf{constructor(e,r,n){super(),this.varKind=e,this.name=r,this.rhs=n}render({es5:e,_n:r}){let n=e?Xl.varKinds.var:this.varKind,i=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${i};`+r}optimizeNames(e,r){if(e[this.name.str])return this.rhs&&(this.rhs=r0(this.rhs,e,r)),this}get names(){return this.rhs instanceof mr._CodeOrName?this.rhs.names:{}}},F3=class extends kf{constructor(e,r,n){super(),this.lhs=e,this.rhs=r,this.sideEffects=n}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,r){if(!(this.lhs instanceof mr.Name&&!e[this.lhs.str]&&!this.sideEffects))return this.rhs=r0(this.rhs,e,r),this}get names(){let e=this.lhs instanceof mr.Name?{}:{...this.lhs.names};return L3(e,this.rhs)}},Tpe=class extends F3{constructor(e,r,n,i){super(e,n,i),this.op=r}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}},kpe=class extends kf{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}},Npe=class extends kf{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`break${this.label?` ${this.label}`:""};`+e}},Ope=class extends kf{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}},Fpe=class extends kf{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,r){return this.code=r0(this.code,e,r),this}get names(){return this.code instanceof mr._CodeOrName?this.code.names:{}}},uk=class extends kf{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((r,n)=>r+n.render(e),"")}optimizeNodes(){let{nodes:e}=this,r=e.length;for(;r--;){let n=e[r].optimizeNodes();Array.isArray(n)?e.splice(r,1,...n):n?e[r]=n:e.splice(r,1)}return e.length>0?this:void 0}optimizeNames(e,r){let{nodes:n}=this,i=n.length;for(;i--;){let o=n[i];o.optimizeNames(e,r)||(jDr(e,o.names),n.splice(i,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((e,r)=>Py(e,r.names),{})}},Nf=class extends uk{render(e){return"{"+e._n+super.render(e)+"}"+e._n}},Qpe=class extends uk{},t0=class extends Nf{};t0.kind="else";var Ly=class t extends Nf{constructor(e,r){super(r),this.condition=e}render(e){let r=`if(${this.condition})`+super.render(e);return this.else&&(r+="else "+this.else.render(e)),r}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(e===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new t0(n):n}if(r)return e===!1?r instanceof t?r:r.nodes:this.nodes.length?this:new t(aut(e),r instanceof t?[r]:r.nodes);if(!(e===!1||!this.nodes.length))return this}optimizeNames(e,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(e,r),!!(super.optimizeNames(e,r)||this.else))return this.condition=r0(this.condition,e,r),this}get names(){let e=super.names;return L3(e,this.condition),this.else&&Py(e,this.else.names),e}};Ly.kind="if";var My=class extends Nf{};My.kind="for";var Lpe=class extends My{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iteration=r0(this.iteration,e,r),this}get names(){return Py(super.names,this.iteration.names)}},Mpe=class extends My{constructor(e,r,n,i){super(),this.varKind=e,this.name=r,this.from=n,this.to=i}render(e){let r=e.es5?Xl.varKinds.var:this.varKind,{name:n,from:i,to:o}=this;return`for(${r} ${n}=${i}; ${n}<${o}; ${n}++)`+super.render(e)}get names(){let e=L3(super.names,this.from);return L3(e,this.to)}},Q3=class extends My{constructor(e,r,n,i){super(),this.loop=e,this.varKind=r,this.name=n,this.iterable=i}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,r){if(super.optimizeNames(e,r))return this.iterable=r0(this.iterable,e,r),this}get names(){return Py(super.names,this.iterable.names)}},dk=class extends Nf{constructor(e,r,n){super(),this.name=e,this.args=r,this.async=n}render(e){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(e)}};dk.kind="func";var fk=class extends uk{render(e){return"return "+super.render(e)}};fk.kind="return";var Ppe=class extends Nf{render(e){let r="try"+super.render(e);return this.catch&&(r+=this.catch.render(e)),this.finally&&(r+=this.finally.render(e)),r}optimizeNodes(){var e,r;return super.optimizeNodes(),(e=this.catch)===null||e===void 0||e.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(e,r){var n,i;return super.optimizeNames(e,r),(n=this.catch)===null||n===void 0||n.optimizeNames(e,r),(i=this.finally)===null||i===void 0||i.optimizeNames(e,r),this}get names(){let e=super.names;return this.catch&&Py(e,this.catch.names),this.finally&&Py(e,this.finally.names),e}},pk=class extends Nf{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}};pk.kind="catch";var hk=class extends Nf{render(e){return"finally"+super.render(e)}};hk.kind="finally";var Upe=class{constructor(e,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
879
879
  `:""},this._extScope=e,this._scope=new Xl.Scope({parent:e}),this._nodes=[new Qpe]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,r){let n=this._extScope.value(e,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(e,r){return this._extScope.getValue(e,r)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,r,n,i){let o=this._scope.toName(r);return n!==void 0&&i&&(this._constants[o.str]=n),this._leafNode(new Bpe(e,o,n)),o}const(e,r,n){return this._def(Xl.varKinds.const,e,r,n)}let(e,r,n){return this._def(Xl.varKinds.let,e,r,n)}var(e,r,n){return this._def(Xl.varKinds.var,e,r,n)}assign(e,r,n){return this._leafNode(new F3(e,r,n))}add(e,r){return this._leafNode(new Tpe(e,zt.operators.ADD,r))}code(e){return typeof e=="function"?e():e!==mr.nil&&this._leafNode(new Fpe(e)),this}object(...e){let r=["{"];for(let[n,i]of e)r.length>1&&r.push(","),r.push(n),(n!==i||this.opts.es5)&&(r.push(":"),(0,mr.addCodeArg)(r,i));return r.push("}"),new mr._Code(r)}if(e,r,n){if(this._blockNode(new Ly(e)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new Ly(e))}else(){return this._elseNode(new t0)}endIf(){return this._endBlockNode(Ly,t0)}_for(e,r){return this._blockNode(e),r&&this.code(r).endFor(),this}for(e,r){return this._for(new Lpe(e),r)}forRange(e,r,n,i,o=this.opts.es5?Xl.varKinds.var:Xl.varKinds.let){let s=this._scope.toName(e);return this._for(new Mpe(o,s,r,n),()=>i(s))}forOf(e,r,n,i=Xl.varKinds.const){let o=this._scope.toName(e);if(this.opts.es5){let s=r instanceof mr.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,mr._)`${s}.length`,a=>{this.var(o,(0,mr._)`${s}[${a}]`),n(o)})}return this._for(new Q3("of",i,o,r),()=>n(o))}forIn(e,r,n,i=this.opts.es5?Xl.varKinds.var:Xl.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,mr._)`Object.keys(${r})`,n);let o=this._scope.toName(e);return this._for(new Q3("in",i,o,r),()=>n(o))}endFor(){return this._endBlockNode(My)}label(e){return this._leafNode(new kpe(e))}break(e){return this._leafNode(new Npe(e))}return(e){let r=new fk;if(this._blockNode(r),this.code(e),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(fk)}try(e,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let i=new Ppe;if(this._blockNode(i),this.code(e),r){let o=this.name("e");this._currNode=i.catch=new pk(o),r(o)}return n&&(this._currNode=i.finally=new hk,this.code(n)),this._endBlockNode(pk,hk)}throw(e){return this._leafNode(new Ope(e))}block(e,r){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(r),this}endBlock(e){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||e!==void 0&&n!==e)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${e} expected`);return this._nodes.length=r,this}func(e,r=mr.nil,n,i){return this._blockNode(new dk(e,r,n)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(dk)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,r){let n=this._currNode;if(n instanceof e||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${e.kind}/${r.kind}`:e.kind}"`)}_elseNode(e){let r=this._currNode;if(!(r instanceof Ly))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let r=this._nodes;r[r.length-1]=e}};zt.CodeGen=Upe;function Py(t,e){for(let r in e)t[r]=(t[r]||0)+(e[r]||0);return t}function L3(t,e){return e instanceof mr._CodeOrName?Py(t,e.names):t}function r0(t,e,r){if(t instanceof mr.Name)return n(t);if(!i(t))return t;return new mr._Code(t._items.reduce((o,s)=>(s instanceof mr.Name&&(s=n(s)),s instanceof mr._Code?o.push(...s._items):o.push(s),o),[]));function n(o){let s=r[o.str];return s===void 0||e[o.str]!==1?o:(delete e[o.str],s)}function i(o){return o instanceof mr._Code&&o._items.some(s=>s instanceof mr.Name&&e[s.str]===1&&r[s.str]!==void 0)}}function jDr(t,e){for(let r in e)t[r]=(t[r]||0)-(e[r]||0)}function aut(t){return typeof t=="boolean"||typeof t=="number"||t===null?!t:(0,mr._)`!${$pe(t)}`}zt.not=aut;var YDr=cut(zt.operators.AND);function HDr(...t){return t.reduce(YDr)}zt.and=HDr;var zDr=cut(zt.operators.OR);function GDr(...t){return t.reduce(zDr)}zt.or=GDr;function cut(t){return(e,r)=>e===mr.nil?r:r===mr.nil?e:(0,mr._)`${$pe(e)} ${t} ${$pe(r)}`}function $pe(t){return t instanceof mr.Name?t:(0,mr._)`(${t})`}});var Cr=b(nr=>{"use strict";Object.defineProperty(nr,"__esModule",{value:!0});nr.checkStrictMode=nr.getErrorPath=nr.Type=nr.useFunc=nr.setEvaluated=nr.evaluatedPropsToName=nr.mergeEvaluated=nr.eachItem=nr.unescapeJsonPointer=nr.escapeJsonPointer=nr.escapeFragment=nr.unescapeFragment=nr.schemaRefOrVal=nr.schemaHasRulesButRef=nr.schemaHasRules=nr.checkUnknownRules=nr.alwaysValidSchema=nr.toHash=void 0;var fn=Yt(),JDr=lk();function VDr(t){let e={};for(let r of t)e[r]=!0;return e}nr.toHash=VDr;function WDr(t,e){return typeof e=="boolean"?e:Object.keys(e).length===0?!0:(dut(t,e),!fut(e,t.self.RULES.all))}nr.alwaysValidSchema=WDr;function dut(t,e=t.schema){let{opts:r,self:n}=t;if(!r.strictSchema||typeof e=="boolean")return;let i=n.RULES.keywords;for(let o in e)i[o]||mut(t,`unknown keyword: "${o}"`)}nr.checkUnknownRules=dut;function fut(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(e[r])return!0;return!1}nr.schemaHasRules=fut;function ZDr(t,e){if(typeof t=="boolean")return!t;for(let r in t)if(r!=="$ref"&&e.all[r])return!0;return!1}nr.schemaHasRulesButRef=ZDr;function XDr({topSchemaRef:t,schemaPath:e},r,n,i){if(!i){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,fn._)`${r}`}return(0,fn._)`${t}${e}${(0,fn.getProperty)(n)}`}nr.schemaRefOrVal=XDr;function KDr(t){return put(decodeURIComponent(t))}nr.unescapeFragment=KDr;function eSr(t){return encodeURIComponent(jpe(t))}nr.escapeFragment=eSr;function jpe(t){return typeof t=="number"?`${t}`:t.replace(/~/g,"~0").replace(/\//g,"~1")}nr.escapeJsonPointer=jpe;function put(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}nr.unescapeJsonPointer=put;function tSr(t,e){if(Array.isArray(t))for(let r of t)e(r);else e(t)}nr.eachItem=tSr;function lut({mergeNames:t,mergeToName:e,mergeValues:r,resultToName:n}){return(i,o,s,a)=>{let c=s===void 0?o:s instanceof fn.Name?(o instanceof fn.Name?t(i,o,s):e(i,o,s),s):o instanceof fn.Name?(e(i,s,o),o):r(o,s);return a===fn.Name&&!(c instanceof fn.Name)?n(i,c):c}}nr.mergeEvaluated={props:lut({mergeNames:(t,e,r)=>t.if((0,fn._)`${r} !== true && ${e} !== undefined`,()=>{t.if((0,fn._)`${e} === true`,()=>t.assign(r,!0),()=>t.assign(r,(0,fn._)`${r} || {}`).code((0,fn._)`Object.assign(${r}, ${e})`))}),mergeToName:(t,e,r)=>t.if((0,fn._)`${r} !== true`,()=>{e===!0?t.assign(r,!0):(t.assign(r,(0,fn._)`${r} || {}`),Ype(t,r,e))}),mergeValues:(t,e)=>t===!0?!0:{...t,...e},resultToName:hut}),items:lut({mergeNames:(t,e,r)=>t.if((0,fn._)`${r} !== true && ${e} !== undefined`,()=>t.assign(r,(0,fn._)`${e} === true ? true : ${r} > ${e} ? ${r} : ${e}`)),mergeToName:(t,e,r)=>t.if((0,fn._)`${r} !== true`,()=>t.assign(r,e===!0?!0:(0,fn._)`${r} > ${e} ? ${r} : ${e}`)),mergeValues:(t,e)=>t===!0?!0:Math.max(t,e),resultToName:(t,e)=>t.var("items",e)})};function hut(t,e){if(e===!0)return t.var("props",!0);let r=t.var("props",(0,fn._)`{}`);return e!==void 0&&Ype(t,r,e),r}nr.evaluatedPropsToName=hut;function Ype(t,e,r){Object.keys(r).forEach(n=>t.assign((0,fn._)`${e}${(0,fn.getProperty)(n)}`,!0))}nr.setEvaluated=Ype;var uut={};function rSr(t,e){return t.scopeValue("func",{ref:e,code:uut[e.code]||(uut[e.code]=new JDr._Code(e.code))})}nr.useFunc=rSr;var qpe;(function(t){t[t.Num=0]="Num",t[t.Str=1]="Str"})(qpe||(nr.Type=qpe={}));function nSr(t,e,r){if(t instanceof fn.Name){let n=e===qpe.Num;return r?n?(0,fn._)`"[" + ${t} + "]"`:(0,fn._)`"['" + ${t} + "']"`:n?(0,fn._)`"/" + ${t}`:(0,fn._)`"/" + ${t}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,fn.getProperty)(t).toString():"/"+jpe(t)}nr.getErrorPath=nSr;function mut(t,e,r=t.opts.strictSchema){if(r){if(e=`strict mode: ${e}`,r===!0)throw new Error(e);t.self.logger.warn(e)}}nr.checkStrictMode=mut});var Of=b(Hpe=>{"use strict";Object.defineProperty(Hpe,"__esModule",{value:!0});var hs=Yt(),iSr={data:new hs.Name("data"),valCxt:new hs.Name("valCxt"),instancePath:new hs.Name("instancePath"),parentData:new hs.Name("parentData"),parentDataProperty:new hs.Name("parentDataProperty"),rootData:new hs.Name("rootData"),dynamicAnchors:new hs.Name("dynamicAnchors"),vErrors:new hs.Name("vErrors"),errors:new hs.Name("errors"),this:new hs.Name("this"),self:new hs.Name("self"),scope:new hs.Name("scope"),json:new hs.Name("json"),jsonPos:new hs.Name("jsonPos"),jsonLen:new hs.Name("jsonLen"),jsonPart:new hs.Name("jsonPart")};Hpe.default=iSr});var mk=b(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.extendErrors=ms.resetErrorsCount=ms.reportExtraError=ms.reportError=ms.keyword$DataError=ms.keywordError=void 0;var vr=Yt(),P3=Cr(),js=Of();ms.keywordError={message:({keyword:t})=>(0,vr.str)`must pass "${t}" keyword validation`};ms.keyword$DataError={message:({keyword:t,schemaType:e})=>e?(0,vr.str)`"${t}" keyword must be ${e} ($data)`:(0,vr.str)`"${t}" keyword is invalid ($data)`};function oSr(t,e=ms.keywordError,r,n){let{it:i}=t,{gen:o,compositeRule:s,allErrors:a}=i,c=yut(t,e,r);n??(s||a)?Aut(o,c):gut(i,(0,vr._)`[${c}]`)}ms.reportError=oSr;function sSr(t,e=ms.keywordError,r){let{it:n}=t,{gen:i,compositeRule:o,allErrors:s}=n,a=yut(t,e,r);Aut(i,a),o||s||gut(n,js.default.vErrors)}ms.reportExtraError=sSr;function aSr(t,e){t.assign(js.default.errors,e),t.if((0,vr._)`${js.default.vErrors} !== null`,()=>t.if(e,()=>t.assign((0,vr._)`${js.default.vErrors}.length`,e),()=>t.assign(js.default.vErrors,null)))}ms.resetErrorsCount=aSr;function cSr({gen:t,keyword:e,schemaValue:r,data:n,errsCount:i,it:o}){if(i===void 0)throw new Error("ajv implementation error");let s=t.name("err");t.forRange("i",i,js.default.errors,a=>{t.const(s,(0,vr._)`${js.default.vErrors}[${a}]`),t.if((0,vr._)`${s}.instancePath === undefined`,()=>t.assign((0,vr._)`${s}.instancePath`,(0,vr.strConcat)(js.default.instancePath,o.errorPath))),t.assign((0,vr._)`${s}.schemaPath`,(0,vr.str)`${o.errSchemaPath}/${e}`),o.opts.verbose&&(t.assign((0,vr._)`${s}.schema`,r),t.assign((0,vr._)`${s}.data`,n))})}ms.extendErrors=cSr;function Aut(t,e){let r=t.const("err",e);t.if((0,vr._)`${js.default.vErrors} === null`,()=>t.assign(js.default.vErrors,(0,vr._)`[${r}]`),(0,vr._)`${js.default.vErrors}.push(${r})`),t.code((0,vr._)`${js.default.errors}++`)}function gut(t,e){let{gen:r,validateName:n,schemaEnv:i}=t;i.$async?r.throw((0,vr._)`new ${t.ValidationError}(${e})`):(r.assign((0,vr._)`${n}.errors`,e),r.return(!1))}var Uy={keyword:new vr.Name("keyword"),schemaPath:new vr.Name("schemaPath"),params:new vr.Name("params"),propertyName:new vr.Name("propertyName"),message:new vr.Name("message"),schema:new vr.Name("schema"),parentSchema:new vr.Name("parentSchema")};function yut(t,e,r){let{createErrors:n}=t.it;return n===!1?(0,vr._)`{}`:lSr(t,e,r)}function lSr(t,e,r={}){let{gen:n,it:i}=t,o=[uSr(i,r),dSr(t,r)];return fSr(t,e,o),n.object(...o)}function uSr({errorPath:t},{instancePath:e}){let r=e?(0,vr.str)`${t}${(0,P3.getErrorPath)(e,P3.Type.Str)}`:t;return[js.default.instancePath,(0,vr.strConcat)(js.default.instancePath,r)]}function dSr({keyword:t,it:{errSchemaPath:e}},{schemaPath:r,parentSchema:n}){let i=n?e:(0,vr.str)`${e}/${t}`;return r&&(i=(0,vr.str)`${i}${(0,P3.getErrorPath)(r,P3.Type.Str)}`),[Uy.schemaPath,i]}function fSr(t,{params:e,message:r},n){let{keyword:i,data:o,schemaValue:s,it:a}=t,{opts:c,propertyName:u,topSchemaRef:d,schemaPath:f}=a;n.push([Uy.keyword,i],[Uy.params,typeof e=="function"?e(t):e||(0,vr._)`{}`]),c.messages&&n.push([Uy.message,typeof r=="function"?r(t):r]),c.verbose&&n.push([Uy.schema,s],[Uy.parentSchema,(0,vr._)`${d}${f}`],[js.default.data,o]),u&&n.push([Uy.propertyName,u])}});var but=b(n0=>{"use strict";Object.defineProperty(n0,"__esModule",{value:!0});n0.boolOrEmptySchema=n0.topBoolOrEmptySchema=void 0;var pSr=mk(),hSr=Yt(),mSr=Of(),ASr={message:"boolean schema is false"};function gSr(t){let{gen:e,schema:r,validateName:n}=t;r===!1?Eut(t,!1):typeof r=="object"&&r.$async===!0?e.return(mSr.default.data):(e.assign((0,hSr._)`${n}.errors`,null),e.return(!0))}n0.topBoolOrEmptySchema=gSr;function ySr(t,e){let{gen:r,schema:n}=t;n===!1?(r.var(e,!1),Eut(t)):r.var(e,!0)}n0.boolOrEmptySchema=ySr;function Eut(t,e){let{gen:r,data:n}=t,i={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:t};(0,pSr.reportError)(i,ASr,void 0,e)}});var zpe=b(i0=>{"use strict";Object.defineProperty(i0,"__esModule",{value:!0});i0.getRules=i0.isJSONType=void 0;var ESr=["string","number","integer","boolean","null","object","array"],bSr=new Set(ESr);function CSr(t){return typeof t=="string"&&bSr.has(t)}i0.isJSONType=CSr;function vSr(){let t={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...t,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},t.number,t.string,t.array,t.object],post:{rules:[]},all:{},keywords:{}}}i0.getRules=vSr});var Gpe=b(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});Cm.shouldUseRule=Cm.shouldUseGroup=Cm.schemaHasRulesForType=void 0;function ISr({schema:t,self:e},r){let n=e.RULES.types[r];return n&&n!==!0&&Cut(t,n)}Cm.schemaHasRulesForType=ISr;function Cut(t,e){return e.rules.some(r=>vut(t,r))}Cm.shouldUseGroup=Cut;function vut(t,e){var r;return t[e.keyword]!==void 0||((r=e.definition.implements)===null||r===void 0?void 0:r.some(n=>t[n]!==void 0))}Cm.shouldUseRule=vut});var Ak=b(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.reportTypeError=As.checkDataTypes=As.checkDataType=As.coerceAndCheckDataType=As.getJSONTypes=As.getSchemaTypes=As.DataType=void 0;var wSr=zpe(),_Sr=Gpe(),DSr=mk(),qt=Yt(),Iut=Cr(),o0;(function(t){t[t.Correct=0]="Correct",t[t.Wrong=1]="Wrong"})(o0||(As.DataType=o0={}));function SSr(t){let e=wut(t.type);if(e.includes("null")){if(t.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!e.length&&t.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');t.nullable===!0&&e.push("null")}return e}As.getSchemaTypes=SSr;function wut(t){let e=Array.isArray(t)?t:t?[t]:[];if(e.every(wSr.isJSONType))return e;throw new Error("type must be JSONType or JSONType[]: "+e.join(","))}As.getJSONTypes=wut;function RSr(t,e){let{gen:r,data:n,opts:i}=t,o=xSr(e,i.coerceTypes),s=e.length>0&&!(o.length===0&&e.length===1&&(0,_Sr.schemaHasRulesForType)(t,e[0]));if(s){let a=Vpe(e,n,i.strictNumbers,o0.Wrong);r.if(a,()=>{o.length?BSr(t,e,o):Wpe(t)})}return s}As.coerceAndCheckDataType=RSr;var _ut=new Set(["string","number","integer","boolean","null"]);function xSr(t,e){return e?t.filter(r=>_ut.has(r)||e==="array"&&r==="array"):[]}function BSr(t,e,r){let{gen:n,data:i,opts:o}=t,s=n.let("dataType",(0,qt._)`typeof ${i}`),a=n.let("coerced",(0,qt._)`undefined`);o.coerceTypes==="array"&&n.if((0,qt._)`${s} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,qt._)`${i}[0]`).assign(s,(0,qt._)`typeof ${i}`).if(Vpe(e,i,o.strictNumbers),()=>n.assign(a,i))),n.if((0,qt._)`${a} !== undefined`);for(let u of r)(_ut.has(u)||u==="array"&&o.coerceTypes==="array")&&c(u);n.else(),Wpe(t),n.endIf(),n.if((0,qt._)`${a} !== undefined`,()=>{n.assign(i,a),TSr(t,a)});function c(u){switch(u){case"string":n.elseIf((0,qt._)`${s} == "number" || ${s} == "boolean"`).assign(a,(0,qt._)`"" + ${i}`).elseIf((0,qt._)`${i} === null`).assign(a,(0,qt._)`""`);return;case"number":n.elseIf((0,qt._)`${s} == "boolean" || ${i} === null
880
880
  || (${s} == "string" && ${i} && ${i} == +${i})`).assign(a,(0,qt._)`+${i}`);return;case"integer":n.elseIf((0,qt._)`${s} === "boolean" || ${i} === null
881
881
  || (${s} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(a,(0,qt._)`+${i}`);return;case"boolean":n.elseIf((0,qt._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(a,!1).elseIf((0,qt._)`${i} === "true" || ${i} === 1`).assign(a,!0);return;case"null":n.elseIf((0,qt._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(a,null);return;case"array":n.elseIf((0,qt._)`${s} === "string" || ${s} === "number"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jaz-clio",
3
- "version": "5.36.14",
3
+ "version": "5.36.16",
4
4
  "description": "Clio: Command Line Interface Operator for Jaz AI.",
5
5
  "type": "module",
6
6
  "bin": {