@cmdoss/agent-pass-plugin 0.1.1-dev.15.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.
- package/dist/http.js +1 -1
- package/dist/mcp.js +1 -1
- package/dist/testnet/read-model.js +16 -8
- package/dist/testnet/runner.js +5 -4
- 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/plans.css +4 -0
- package/skills/agent-pass-plugin-trading/SKILL.md +41 -3
package/dist/http.js
CHANGED
|
@@ -16,7 +16,7 @@ export function setupInfo(port, mode = "paper") {
|
|
|
16
16
|
? `Install locked dependencies if missing and run npm run build, then run PORT=${port} AGENT_PASS_PLUGIN_MODE=${mode} node scripts/setup.mjs --client codex (or claude) --register --start.`
|
|
17
17
|
: `This package is already compiled; do not run npm ci or build inside it. Run PORT=${port} AGENT_PASS_PLUGIN_MODE=${mode} node "${root}/dist/cli.js" setup --client codex (or claude) --register --start.`;
|
|
18
18
|
return {
|
|
19
|
-
prompt: `Set up Agent Pass Plugin from ${root}. Read skills/agent-pass-plugin-trading/SKILL.md. Identify whether this is Codex or Claude Code. ${prepare} Verify agent-pass-plugin MCP tools; if a client restart is required, explain that and continue from saved setup.json. ${mode === "testnet" ? "Call onboard first: it must automatically open the Agent Pass Plugin wallet connection page if no fresh browser connection exists. Poll onboarding_status and report onboarding complete only after onboardingComplete is true; browser launch or an old address hint is insufficient.
|
|
19
|
+
prompt: `Set up Agent Pass Plugin from ${root}. Read skills/agent-pass-plugin-trading/SKILL.md. Identify whether this is Codex or Claude Code. ${prepare} Verify agent-pass-plugin MCP tools; if a client restart is required, explain that and continue from saved setup.json. ${mode === "testnet" ? "Call onboard first: it must automatically open the Agent Pass Plugin wallet connection page if no fresh browser connection exists. Poll onboarding_status and report onboarding complete only after onboardingComplete is true; browser launch or an old address hint is insufficient. Read testnet_capabilities, then ask me for every missing create_testnet_plan value in one message (wallet owner, direction, decimal amounts, price bound, route, duration and gas caps) and keep my earlier answers. Never invent a price or spending limit, and give every number its unit (input asset, demo USDC per SUI, test SUI). Label each step: proposal, confirmed configuration, wallet authorization, Start. After I confirm the configuration, create one draft, request official Agent Pass authorization, show exact returned rules/warnings and wallet review link, and poll verified chain status. Name yourself (Codex or Claude Code) when telling me to return from the browser. When resuming, read list_plans and pending reviews first; continue the existing plan and reuse the same requestId instead of creating another plan or authorization request. Owner signatures and Start are separate explicit user actions. Mainnet is disabled." : "Guide me through paper account/funding/plan review links. This is simulated trading, not onchain."} Never confirm/sign reviews for me, request a private key, or start a plan without my explicit instruction.`,
|
|
20
20
|
promptPreview: "Set up Agent Pass Plugin, connect its MCP, and help me start a strategy.",
|
|
21
21
|
commands: {
|
|
22
22
|
codex: `codex mcp add agent-pass-plugin --env AGENT_PASS_PLUGIN_LOCAL_URL=http://127.0.0.1:${port} -- node ${root}/dist/mcp.js`,
|
package/dist/mcp.js
CHANGED
|
@@ -65,7 +65,7 @@ async function api(path, body) {
|
|
|
65
65
|
}
|
|
66
66
|
catch (error) {
|
|
67
67
|
const value = {
|
|
68
|
-
error: `Local runtime unavailable. Start npm run dev in
|
|
68
|
+
error: `Local runtime unavailable at ${base.origin}. Start it with \`agent-pass-plugin start\` (npm install) or \`npm run dev\` (source checkout), then retry this exact call; reuse the same requestId. Plans, passes and submitted digests stay in local storage. A restart pauses running plans and never authorizes, Starts or Resumes them. ${error.message}`,
|
|
69
69
|
};
|
|
70
70
|
return {
|
|
71
71
|
isError: true,
|
|
@@ -44,7 +44,11 @@ export class TestnetReadModel {
|
|
|
44
44
|
}
|
|
45
45
|
: null;
|
|
46
46
|
const spentIn = display(plan.spent, policy.coinIn.decimals), holdingsOut = display(plan.output, policy.coinOut.decimals);
|
|
47
|
-
const
|
|
47
|
+
const pendingSubmissions = this.repository
|
|
48
|
+
.intents()
|
|
49
|
+
.filter((i) => i.planId === plan.id && i.state === "submitted").length;
|
|
50
|
+
// An unreconciled submission makes holdings/spend unknown; never show it as zero profit.
|
|
51
|
+
const pnl = pendingSubmissions === 0 && valuation && input.direction === "usdc_to_sui"
|
|
48
52
|
? Number(holdingsOut) * Number(valuation.price) - Number(spentIn)
|
|
49
53
|
: null;
|
|
50
54
|
return {
|
|
@@ -64,6 +68,8 @@ export class TestnetReadModel {
|
|
|
64
68
|
expiresAt: plan.expiresAt,
|
|
65
69
|
lastReason: plan.lastReason,
|
|
66
70
|
nextRunAt: plan.nextRunAt,
|
|
71
|
+
// Count only: digests, bytes and signatures of unresolved work stay in local state.
|
|
72
|
+
pendingSubmissions,
|
|
67
73
|
coinIn: policy.coinIn,
|
|
68
74
|
coinOut: policy.coinOut,
|
|
69
75
|
spentIn,
|
|
@@ -72,13 +78,15 @@ export class TestnetReadModel {
|
|
|
72
78
|
gasSui: input.gasSui,
|
|
73
79
|
gasSpentSui: plan.gas,
|
|
74
80
|
pnlUsdc: pnl,
|
|
75
|
-
pnlReason:
|
|
76
|
-
? "
|
|
77
|
-
:
|
|
78
|
-
? "
|
|
79
|
-
:
|
|
80
|
-
?
|
|
81
|
-
:
|
|
81
|
+
pnlReason: pendingSubmissions > 0
|
|
82
|
+
? "A submitted transaction is not reconciled yet; profit is unavailable until it settles"
|
|
83
|
+
: input.direction === "sui_to_usdc"
|
|
84
|
+
? "Acquisition cost basis for input SUI is unavailable; sale proceeds are not profit"
|
|
85
|
+
: !valuation
|
|
86
|
+
? "No confirmed venue valuation"
|
|
87
|
+
: fresh
|
|
88
|
+
? null
|
|
89
|
+
: `Profit uses the last confirmed venue mark from ${valuation.asOf}; it is not a live quote`,
|
|
82
90
|
valuation,
|
|
83
91
|
authorization: this.publicAuthorization(plan),
|
|
84
92
|
revocationUrl: plan.status === "revoking" ? plan.revocationUrl : undefined,
|
package/dist/testnet/runner.js
CHANGED
|
@@ -164,10 +164,11 @@ export class TestnetRunner {
|
|
|
164
164
|
guardPlan(plan, this.now(), epoch);
|
|
165
165
|
if (!inspection.active || inspection.revoked || inspection.expired)
|
|
166
166
|
throw new Error(inspection.reason || "Onchain permission is no longer active");
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
167
|
+
// Same guard as before; separate messages give the owner a specific next step.
|
|
168
|
+
if (BigInt(inspection.ownerInputBalance) < BigInt(plan.policy.amountIn))
|
|
169
|
+
throw new Error("Insufficient testnet input address balance for one order");
|
|
170
|
+
if (BigInt(inspection.agentGasBalance) < 10000000n)
|
|
171
|
+
throw new Error("Insufficient agent gas (below 0.01 test SUI)");
|
|
171
172
|
const today = day(inspection.chainTimeMs), todaySpent = sum(plan.history
|
|
172
173
|
.filter((h) => h.type === "filled" && h.at.slice(0, 10) === today)
|
|
173
174
|
.map((h) => units(h.amountIn, plan.policy.coinIn.decimals)));
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cmdoss/agent-pass-plugin",
|
|
3
|
-
"version": "0.1.1-dev.
|
|
3
|
+
"version": "0.1.1-dev.18.1",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@cmdoss/agent-pass-plugin",
|
|
9
|
-
"version": "0.1.1-dev.
|
|
9
|
+
"version": "0.1.1-dev.18.1",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@fastify/static": "10.1.10",
|
|
12
12
|
"@modelcontextprotocol/sdk": "1.32.2",
|
package/package.json
CHANGED