@cmdoss/agent-pass-plugin 0.1.2-dev.19.1 → 0.1.2-dev.22.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.
- package/README.md +2 -1
- package/dist/mcp.js +9 -4
- package/dist/shared/constants.js +7 -0
- package/dist/testnet/authorization.js +78 -0
- package/dist/testnet/engine.js +14 -3
- package/dist/testnet/read-model.js +3 -0
- package/docs/agent-pass-integration.md +8 -2
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/public/assets/agent-pass-plugin-client.js +4 -4
- package/public/assets/agent-pass-plugin-sdk.js +1 -1
- package/public/styles/review.css +99 -0
- package/skills/agent-pass-plugin-trading/SKILL.md +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
var l="Agent Pass Plugin";var d=Object.freeze({decimals:3}),
|
|
1
|
+
var l="Agent Pass Plugin";var d="Stop the agent now",u="Close the pass",w=`Open the Agent Pass page, choose "${d}" (revokes the agent key and deletes its allowances; the pass stays) or "${u}" (does the same and also returns everything the pass holds to the owner wallet), then approve in the owner wallet. Only the owner presses these buttons; the agent never does.`;var p=Object.freeze({decimals:3}),f=Object.freeze({leading:3,trailing:3,ellipsis:"\u2026",addressPrefix:"0x"}),T=Object.freeze({codex:"Codex",claude:"Claude Code",fallback:"your agent"});function h(n,o=p.decimals){return new Intl.NumberFormat("en-US",{minimumFractionDigits:0,maximumFractionDigits:Math.min(o,p.decimals)}).format(Number(n)||0)}function c(n){let o=String(n??""),{leading:r,trailing:i,ellipsis:e,addressPrefix:t}=f,s=o.startsWith(t)?t:"",a=o.slice(s.length);return a.length>r+i+e.length?`${s}${a.slice(0,r)}${e}${a.slice(-i)}`:o||"\u2014"}var S="https://agent-pass-plugin.commandoss.com",g=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"),g.has(o))continue;let r=()=>{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`)},i=new ResizeObserver(r);i.observe(o),i.observe(n),g.set(o,i),r()}}function b(){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=`${S}/#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 s=decodeURIComponent(t[1]);e.title=s,e.textContent=e.textContent.startsWith("Owner ")?`Owner ${c(s)}`:c(s),e.dataset.pluginShort="true"}),location.hash.startsWith("#/authorize/")){let e=document.querySelector(".hero h1");e&&e.textContent!=="Sign authorization"&&(e.textContent="Sign authorization")}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 e=i.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 s=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,a=>h(a));s!==t.textContent&&(e.title||=t.textContent,t.textContent=s)}}),document.querySelectorAll(".balance").forEach(e=>{for(let t of e.childNodes){if(t.nodeType!==Node.TEXT_NODE)continue;let s=t.textContent.trim();if(!/^\d+(\.\d+)?$/.test(s))continue;let a=h(s);s!==a&&(e.title=s,t.textContent=`${a} `)}})}var O=new MutationObserver(b);O.observe(document.body,{childList:!0,subtree:!0});b();var A=await fetch("/plugin/styles/sdk-wallet.css").then(n=>n.text()),x=new WeakSet;function m(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(!x.has(r)){x.add(r);let i=document.createElement("style");i.textContent=A,r.append(i),new MutationObserver(()=>m(r)).observe(r,{childList:!0,subtree:!0})}m(r)}}}function y(){for(let n of document.querySelectorAll("mysten-dapp-kit-connect-button"))m(n.parentElement)}new MutationObserver(y).observe(document.body,{childList:!0,subtree:!0});y();
|
package/public/styles/review.css
CHANGED
|
@@ -148,3 +148,102 @@
|
|
|
148
148
|
font-size: 18px;
|
|
149
149
|
line-height: 1.4;
|
|
150
150
|
}
|
|
151
|
+
/* TRE-8: authorization review reuses the strategy detail layout. */
|
|
152
|
+
.authorization-review .strategy-summary .review-top {
|
|
153
|
+
display: flex;
|
|
154
|
+
align-items: center;
|
|
155
|
+
justify-content: space-between;
|
|
156
|
+
gap: 16px;
|
|
157
|
+
margin-bottom: 16px;
|
|
158
|
+
}
|
|
159
|
+
.authorization-review .strategy-summary .review-top .eyebrow {
|
|
160
|
+
color: var(--blue-ink);
|
|
161
|
+
}
|
|
162
|
+
.authorization-review .review-rail .review-outcome,
|
|
163
|
+
.authorization-review .review-rail .small-note {
|
|
164
|
+
flex-shrink: 0;
|
|
165
|
+
}
|
|
166
|
+
.authorization-review .review-rail #view-error:empty {
|
|
167
|
+
display: none;
|
|
168
|
+
}
|
|
169
|
+
.authorization-review .strategy-summary {
|
|
170
|
+
gap: 24px;
|
|
171
|
+
}
|
|
172
|
+
.authorization-review .review-key-facts > div {
|
|
173
|
+
padding: 10px 0;
|
|
174
|
+
}
|
|
175
|
+
/* Keep the status note and the single primary action in view while the
|
|
176
|
+
key facts scroll; the note never slides under the button. */
|
|
177
|
+
.authorization-review .review-rail .review-rail-footer {
|
|
178
|
+
position: sticky;
|
|
179
|
+
bottom: -24px;
|
|
180
|
+
z-index: 1;
|
|
181
|
+
display: flex;
|
|
182
|
+
flex-direction: column;
|
|
183
|
+
gap: 16px;
|
|
184
|
+
margin: auto -24px -24px;
|
|
185
|
+
padding: 16px 24px 24px;
|
|
186
|
+
border-top: 1px solid var(--line-soft);
|
|
187
|
+
background: var(--surface);
|
|
188
|
+
}
|
|
189
|
+
.authorization-review .review-rail .review-actions {
|
|
190
|
+
flex-direction: column-reverse;
|
|
191
|
+
align-items: stretch;
|
|
192
|
+
gap: 12px;
|
|
193
|
+
}
|
|
194
|
+
.authorization-review .review-rail .review-actions:empty {
|
|
195
|
+
display: none;
|
|
196
|
+
}
|
|
197
|
+
.authorization-review .review-rail .review-actions .button {
|
|
198
|
+
width: 100%;
|
|
199
|
+
margin-top: 0;
|
|
200
|
+
}
|
|
201
|
+
.authorization-review .review-details h2 {
|
|
202
|
+
margin-bottom: 8px;
|
|
203
|
+
font-size: 24px;
|
|
204
|
+
line-height: 1.2;
|
|
205
|
+
letter-spacing: -0.02em;
|
|
206
|
+
}
|
|
207
|
+
.authorization-review .review-details .definition-list {
|
|
208
|
+
max-width: 760px;
|
|
209
|
+
}
|
|
210
|
+
.authorization-review .review-expander {
|
|
211
|
+
max-width: 760px;
|
|
212
|
+
}
|
|
213
|
+
.authorization-review .review-expander-body {
|
|
214
|
+
margin-top: 16px;
|
|
215
|
+
color: #c2c6cd;
|
|
216
|
+
font-size: 14px;
|
|
217
|
+
line-height: 1.5;
|
|
218
|
+
}
|
|
219
|
+
.authorization-review .review-expander-body p + p {
|
|
220
|
+
margin-top: 12px;
|
|
221
|
+
}
|
|
222
|
+
.authorization-review .review-expander-body .skill-document {
|
|
223
|
+
max-height: 320px;
|
|
224
|
+
overflow: auto;
|
|
225
|
+
}
|
|
226
|
+
.authorization-review .review-identifiers {
|
|
227
|
+
display: block;
|
|
228
|
+
font-size: 12px;
|
|
229
|
+
line-height: 1.6;
|
|
230
|
+
overflow-wrap: anywhere;
|
|
231
|
+
}
|
|
232
|
+
@media (max-width: 520px) {
|
|
233
|
+
.authorization-review .strategy-summary {
|
|
234
|
+
display: flex;
|
|
235
|
+
flex-direction: column;
|
|
236
|
+
}
|
|
237
|
+
.authorization-review .strategy-summary .definition-list {
|
|
238
|
+
grid-row: auto;
|
|
239
|
+
}
|
|
240
|
+
.authorization-review .review-rail .review-rail-footer {
|
|
241
|
+
position: static;
|
|
242
|
+
margin: 0;
|
|
243
|
+
padding: 16px 0 0;
|
|
244
|
+
}
|
|
245
|
+
.authorization-review .review-rail .review-actions .button {
|
|
246
|
+
width: 100%;
|
|
247
|
+
align-self: stretch;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
@@ -30,8 +30,8 @@ Keep the agent-led flow short and in this order: **user intent → missing param
|
|
|
30
30
|
2. **Confirmed configuration** — the user agreed to the exact values; create the draft and show `review_plan`.
|
|
31
31
|
3. **Wallet authorization** — the owner reviews and signs in the official review page; you only show the link and poll.
|
|
32
32
|
4. **Start** — a separate explicit instruction after verified authorization. Never ask "authorize and start?" together.
|
|
33
|
-
- **Units.** Attach a unit to every number: amounts, budgets and daily caps in the **input asset** (`demo USDC` or `test SUI`); `limitPrice` in `demo USDC per SUI`; gas in `test SUI`; interval in seconds;
|
|
34
|
-
- **Concise summary.** Before creating the draft, show one compact list: owner (shortened), strategy and direction, per-order / lifetime / daily amounts with unit, limit price, interval,
|
|
33
|
+
- **Units.** Attach a unit to every number: amounts, budgets and daily caps in the **input asset** (`demo USDC` or `test SUI`); `limitPrice` in `demo USDC per SUI`; gas in `test SUI`; interval in seconds; the permission window in days. Call `durationDays` the permission window, e.g. "Permission valid for 1 day", never a bare "Duration": it is how long the strategy may submit trades within the approved limits, not the interval between trades and not how long the service runs. Before signing the expiry is only an estimate; after signing the plan uses the expiry verified on chain. Expiry stops new submissions, submitted transactions still reconcile, holdings stay in the owner wallet, and Start does not reset it. Never write `$` or plain "USDC dollars"; Testnet assets have no dollar value. Echo the decimal strings the user gave rather than rounded display values.
|
|
34
|
+
- **Concise summary.** Before creating the draft, show one compact list: owner (shortened), strategy and direction, per-order / lifetime / daily amounts with unit, limit price, interval, permission window (days), slippage and venue, gas stipend / lifetime / daily caps. Add only what the user must decide; leave rules text for the authorization step.
|
|
35
35
|
- **Name the actual client in handoffs.** You are either Codex or Claude Code; say that name, not "your agent", in every browser handoff and return instruction: "I opened the wallet page in your browser. Connect there, then come back to Claude Code." The wallet page uses the MCP client name for its return button.
|
|
36
36
|
- **Recover without duplicates.** For a returning user, or after an interrupted turn, first read state: `marketplace_status`, `onboarding_status` or `account_status`, `list_plans`, then `get_review_request` for a known review ID and `list_transactions` for submitted work. Summarize what exists before proposing anything.
|
|
37
37
|
- An existing draft, approved, paused or blocked plan is continued or explicitly stopped by the user; never create a second plan to "start over". Plan creation is not idempotent.
|
|
@@ -63,7 +63,7 @@ Use `list_plans` and `list_transactions({planId?})`. Report actual digests and c
|
|
|
63
63
|
|
|
64
64
|
`pause_plan` prevents new local execution; `resume_plan` requires explicit user intent and rechecks the same bound plan. `stop_plan` ends local scheduling. These operations do not liquidate holdings or revoke an onchain pass.
|
|
65
65
|
|
|
66
|
-
`revoke_plan` first blocks new local submissions and returns the official owner
|
|
66
|
+
`revoke_plan` first blocks new local submissions and returns the official Agent Pass page URL with `revocationSteps`. That page has no "Revoke" button, so name the exact buttons: open the pass page, choose **Stop the agent now** (revokes the agent key and deletes its allowances; the pass stays) or **Close the pass** (same, and also returns everything the pass holds to the owner wallet), then approve in the wallet. The owner must sign; never press either button yourself. Once confirmed, the `revoked` history entry carries the owner's revocation digest when it could be verified from chain; if it is absent, say the digest was not recorded rather than inventing one. While status is `revoking`, do not claim it is revoked or offer Start/resume. Report confirmed onchain revocation only after fresh verified state. Transactions submitted before pause/stop/revocation still need reconciliation.
|
|
67
67
|
|
|
68
68
|
The computer/runtime must remain online. Browser/chat closure and Logout do not stop jobs or revoke a pass. If the user's intent is to stop trading, perform the appropriate local control within their authorization and explain the remaining owner-signature step for onchain revoke.
|
|
69
69
|
|