@cmdoss/agent-pass-plugin 0.1.1-dev.17.1 → 0.1.1-dev.18.1

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 +1 @@
1
- var l="Agent Pass Plugin";var d=Object.freeze({decimals:3}),f=Object.freeze({leading:3,trailing:3,ellipsis:"\u2026",addressPrefix:"0x"}),y=Object.freeze({codex:"Codex",claude:"Claude Code",fallback:"your agent"});function u(n,o=d.decimals){return new Intl.NumberFormat("en-US",{minimumFractionDigits:0,maximumFractionDigits:Math.min(o,d.decimals)}).format(Number(n)||0)}function c(n){let o=String(n??""),{leading:r,trailing:i,ellipsis:t,addressPrefix:e}=f,a=o.startsWith(e)?e:"",s=o.slice(a.length);return s.length>r+i+t.length?`${a}${s.slice(0,r)}${t}${s.slice(-i)}`:o||"\u2014"}var w="http://127.0.0.1:4317",m=new WeakMap;function S(){for(let n of document.querySelectorAll("aside .panel > h2")){if(n.textContent.trim()!=="Held by the pass")continue;let o=n.parentElement;if(o.classList.add("sdk-split-cards"),n.classList.add("sdk-held-title"),m.has(o))continue;let r=()=>{let t=n.getBoundingClientRect().top-o.getBoundingClientRect().top-24;o.style.setProperty("--held-card-start",`${t}px`),o.style.setProperty("--balance-card-end",`${t-24}px`)},i=new ResizeObserver(r);i.observe(o),i.observe(n),m.set(o,i),r()}}function x(){document.documentElement.dataset.sdkPage=location.hash.startsWith("#/authorize/")?"authorization":"pass",document.title=`${l} \xB7 Agent Pass`;let n=document.querySelector("main > header");if(n&&!n.dataset.pluginTheme){n.dataset.pluginTheme="true",n.classList.add("app-header");let t=n.querySelector(".brand");t&&(t.textContent=l,t.classList.add("wordmark"),t.href=`${w}/#home`);let e=n.querySelector(".nav");e&&(e.className="sdk-subnav",n.after(e))}if(S(),document.querySelectorAll("p.fine").forEach(t=>{t.textContent.startsWith("Deletes the pass, its policies, its receipt and any remaining allowances,")&&t.classList.add("sdk-omit")}),document.querySelectorAll("button, a.primary, a.revoke").forEach(t=>{if(t.classList.add("button"),(t.classList.contains("primary")||t.classList.contains("revoke"))&&!t.querySelector(".action-arrow")){let e=document.createElement("span");e.className="action-arrow",e.setAttribute("aria-hidden","true"),e.textContent="\u2197",t.append(e)}}),document.querySelectorAll('a[href*="/object/"], a[href*="/tx/"], a[href*="/account/"], a[href*="#/owner/"]').forEach(t=>{let e=t.getAttribute("href").match(/(?:object|tx|owner|account)\/([^/?#]+)/);if(!e||t.dataset.pluginShort)return;let a=decodeURIComponent(e[1]);t.title=a,t.textContent=t.textContent.startsWith("Owner ")?`Owner ${c(a)}`:c(a),t.dataset.pluginShort="true"}),location.hash.startsWith("#/authorize/")){let t=document.querySelector(".hero h1");t&&t.textContent!=="Authorize plan"&&(t.textContent="Authorize plan")}let o=location.hash.match(/^#\/pass\/(0x[a-f\d]+)/i)?.[1],r=document.querySelector(".hero h1");o&&r&&!r.dataset.pluginTitle&&(r.title=r.textContent,r.textContent=`Agent Pass ${c(o)}`,r.dataset.pluginTitle="true");let i=document.querySelector(".crumbs");if(o&&i){let t=i.lastChild,e=`Agent Pass ${c(o)}`;t?.nodeType===Node.TEXT_NODE&&t.textContent!==e&&(t.textContent=e)}document.querySelectorAll(".attempt strong, .attempt .moved").forEach(t=>{for(let e of t.childNodes){if(e.nodeType!==Node.TEXT_NODE)continue;let a=e.textContent.replace(/0x([a-f\d]{3})[a-f\d]*…[a-f\d]*([a-f\d]{3})/gi,"0x$1\u2026$2").replace(/\b(\d+\.\d{4,})\b/g,s=>u(s));a!==e.textContent&&(t.title||=e.textContent,e.textContent=a)}}),document.querySelectorAll(".balance").forEach(t=>{for(let e of t.childNodes){if(e.nodeType!==Node.TEXT_NODE)continue;let a=e.textContent.trim();if(!/^\d+(\.\d+)?$/.test(a))continue;let s=u(a);a!==s&&(t.title=a,e.textContent=`${s} `)}})}var C=new MutationObserver(x);C.observe(document.body,{childList:!0,subtree:!0});x();var N=await fetch("/plugin/styles/sdk-wallet.css").then(n=>n.text()),h=new WeakSet;function p(n){if(n.host?.tagName==="CONNECTED-ACCOUNT-MENU"){let o=n.host.connection?.account?.address,r=n.querySelector(".trigger-content");if(o&&r){for(let i of r.childNodes)i.nodeType===Node.TEXT_NODE&&i.textContent.trim()&&i.textContent!==c(o)&&(i.textContent=c(o));r.title=o}}for(let o of n.querySelectorAll("*")){let r=o.shadowRoot;if(r){if(!h.has(r)){h.add(r);let i=document.createElement("style");i.textContent=N,r.append(i),new MutationObserver(()=>p(r)).observe(r,{childList:!0,subtree:!0})}p(r)}}}function g(){for(let n of document.querySelectorAll("mysten-dapp-kit-connect-button"))p(n.parentElement)}new MutationObserver(g).observe(document.body,{childList:!0,subtree:!0});g();
1
+ var l="Agent Pass Plugin";var d=Object.freeze({decimals:3}),h=Object.freeze({leading:3,trailing:3,ellipsis:"\u2026",addressPrefix:"0x"}),w=Object.freeze({codex:"Codex",claude:"Claude Code",fallback:"your agent"});function u(n,o=d.decimals){return new Intl.NumberFormat("en-US",{minimumFractionDigits:0,maximumFractionDigits:Math.min(o,d.decimals)}).format(Number(n)||0)}function c(n){let o=String(n??""),{leading:i,trailing:r,ellipsis:e,addressPrefix:t}=h,a=o.startsWith(t)?t:"",s=o.slice(a.length);return s.length>i+r+e.length?`${a}${s.slice(0,i)}${e}${s.slice(-r)}`:o||"\u2014"}var y="http://127.0.0.1:4317",f=new WeakMap;function v(){for(let n of document.querySelectorAll("aside .panel > h2")){if(n.textContent.trim()!=="Held by the pass")continue;let o=n.parentElement;if(o.classList.add("sdk-split-cards"),n.classList.add("sdk-held-title"),f.has(o))continue;let i=()=>{let e=n.getBoundingClientRect().top-o.getBoundingClientRect().top-24;o.style.setProperty("--held-card-start",`${e}px`),o.style.setProperty("--balance-card-end",`${e-24}px`)},r=new ResizeObserver(i);r.observe(o),r.observe(n),f.set(o,r),i()}}function g(){document.documentElement.dataset.sdkPage=location.hash.startsWith("#/authorize/")?"authorization":"pass",document.title=`${l} \xB7 Agent Pass`;let n=document.querySelector("main > header");if(n&&!n.dataset.pluginTheme){n.dataset.pluginTheme="true",n.classList.add("app-header");let e=n.querySelector(".brand");e&&(e.textContent=l,e.classList.add("wordmark"),e.href=`${y}/#home`);let t=n.querySelector(".nav");t&&(t.className="sdk-subnav",n.after(t))}if(v(),document.querySelectorAll("p.fine").forEach(e=>{e.textContent.startsWith("Deletes the pass, its policies, its receipt and any remaining allowances,")&&e.classList.add("sdk-omit")}),document.querySelectorAll("button, a.primary, a.revoke").forEach(e=>{if(e.classList.add("button"),(e.classList.contains("primary")||e.classList.contains("revoke"))&&!e.querySelector(".action-arrow")){let t=document.createElement("span");t.className="action-arrow",t.setAttribute("aria-hidden","true"),t.textContent="\u2197",e.append(t)}}),document.querySelectorAll('a[href*="/object/"], a[href*="/tx/"], a[href*="/account/"], a[href*="#/owner/"]').forEach(e=>{let t=e.getAttribute("href").match(/(?:object|tx|owner|account)\/([^/?#]+)/);if(!t||e.dataset.pluginShort)return;let a=decodeURIComponent(t[1]);e.title=a,e.textContent=e.textContent.startsWith("Owner ")?`Owner ${c(a)}`:c(a),e.dataset.pluginShort="true"}),location.hash.startsWith("#/authorize/")){let e=document.querySelector(".hero h1");e&&e.textContent!=="Authorize plan"&&(e.textContent="Authorize plan")}let o=location.hash.match(/^#\/pass\/(0x[a-f\d]+)/i)?.[1],i=document.querySelector(".hero h1");o&&i&&!i.dataset.pluginTitle&&(i.title=i.textContent,i.textContent=`Agent Pass ${c(o)}`,i.dataset.pluginTitle="true");let r=document.querySelector(".crumbs");if(o&&r){let e=r.lastChild,t=`Agent Pass ${c(o)}`;e?.nodeType===Node.TEXT_NODE&&e.textContent!==t&&(e.textContent=t)}document.querySelectorAll(".attempt strong, .attempt .moved").forEach(e=>{for(let t of e.childNodes){if(t.nodeType!==Node.TEXT_NODE)continue;let a=t.textContent.replace(/0x([a-f\d]{3})[a-f\d]*…[a-f\d]*([a-f\d]{3})/gi,"0x$1\u2026$2").replace(/\b(\d+\.\d{4,})\b/g,s=>u(s));a!==t.textContent&&(e.title||=t.textContent,t.textContent=a)}}),document.querySelectorAll(".balance").forEach(e=>{for(let t of e.childNodes){if(t.nodeType!==Node.TEXT_NODE)continue;let a=t.textContent.trim();if(!/^\d+(\.\d+)?$/.test(a))continue;let s=u(a);a!==s&&(e.title=a,t.textContent=`${s} `)}})}var N=new MutationObserver(g);N.observe(document.body,{childList:!0,subtree:!0});g();var S=await fetch("/plugin/styles/sdk-wallet.css").then(n=>n.text()),m=new WeakSet;function p(n){if(n.host?.tagName==="CONNECTED-ACCOUNT-MENU"){let o=n.host.connection?.account?.address,i=n.querySelector(".trigger-content");if(o&&i){for(let r of i.childNodes)r.nodeType===Node.TEXT_NODE&&r.textContent.trim()&&r.textContent!==c(o)&&(r.textContent=c(o));i.title=o}}for(let o of n.querySelectorAll("*")){let i=o.shadowRoot;if(i){if(!m.has(i)){m.add(i);let r=document.createElement("style");r.textContent=S,i.append(r),new MutationObserver(()=>p(i)).observe(i,{childList:!0,subtree:!0})}p(i)}}}function x(){for(let n of document.querySelectorAll("mysten-dapp-kit-connect-button"))p(n.parentElement)}new MutationObserver(x).observe(document.body,{childList:!0,subtree:!0});x();
@@ -269,3 +269,7 @@
269
269
  .activity-pagination {
270
270
  padding: 10px 24px;
271
271
  }
272
+ .plan-detail .recovery-next {
273
+ color: #c2c6cd;
274
+ font-size: 14px;
275
+ }
@@ -69,6 +69,24 @@ The computer/runtime must remain online. Browser/chat closure and Logout do not
69
69
 
70
70
  PnL is denominated in **demo USDC**, with the valuation source/time disclosed and gas separately recorded in SUI. Unknown/stale valuation or missing cost basis stays unavailable. Selling SUI without acquisition basis is proceeds, not proven profit. Do not combine Testnet records with Paper fills or count funding as trading profit.
71
71
 
72
+ ## Errors and recovery
73
+
74
+ Explain the current state in one line, then one next step. Never fix a problem by authorizing, Starting, Resuming or broadening a plan yourself.
75
+
76
+ | Situation | State | Next step to offer |
77
+ | ------------------------------------------------------------------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
78
+ | Owner input balance below one order | blocked | Owner adds the input asset (`demo USDC` or `test SUI`) to the owner wallet, then asks to Resume. Nothing was submitted. |
79
+ | Agent gas below 0.01 test SUI | blocked | Owner tops up agent gas through the official Agent Pass page; Agent Pass Plugin never refills gas. Then Resume on request. |
80
+ | Wallet rejected or review page closed | pending | Re-show the same `reviewUrl`; retry with the same `requestId`. No new plan or request. |
81
+ | Local runtime unreachable (MCP returns "Local runtime unavailable") | unknown | Ask the user to start it (`agent-pass-plugin start` for npm installs, `npm run dev` in a checkout), then retry the exact same call. After restart, running plans are paused. |
82
+ | Network or RPC interruption | blocked | No new order was sent in that cycle. Check the connection, then Resume on request; submitted digests reconcile automatically. |
83
+ | Submitted transaction not yet confirmed (`pendingSubmissions` > 0) | pending | Wait; the runtime looks up the saved digest. Resume and new plans stay unavailable until it settles. |
84
+ | Transaction failed onchain | failed | Gas was recorded and no fill counted. Report the reason; Resume only on request. |
85
+ | Pass or plan term ended | expired | Stop the plan; a new reviewed plan is needed. |
86
+ | Pass revoked | revoked | No new orders. Holdings stay with the owner. A new plan and authorization are needed to trade again. |
87
+
88
+ Keep these five states distinct: **pending** (waiting for a signature or a digest), **failed** (a transaction failed), **blocked** (a guard stopped new orders until fixed and resumed), **expired** and **revoked** (terminal). When PnL is unavailable or uses a mark older than 60 seconds, say so and quote `pnlReason`; never report it as zero or as a live valuation.
89
+
72
90
  ## Explicit Paper branch
73
91
 
74
92
  Use Paper only when `AGENT_PASS_PLUGIN_MODE=paper` is deliberately selected. A separate example is `AGENT_PASS_PLUGIN_MODE=paper AGENT_PASS_PLUGIN_DATA_DIR=.data/paper-demo PORT=4318 npm run dev`; pass matching variables when registering that service through setup. Do not silently switch an existing runtime or reuse its live session as a simulated account.