@cmdoss/agent-pass-plugin 0.1.1 → 0.1.2-dev.19.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 +1 -1
- 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/docs/npm-release.md +11 -9
- 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/README.md
CHANGED
|
@@ -104,7 +104,7 @@ npm run build
|
|
|
104
104
|
npm run start:web # public catalog, port 3000
|
|
105
105
|
```
|
|
106
106
|
|
|
107
|
-
|
|
107
|
+
Production uses Railway's GitHub integration and root Dockerfile, port 8080 and
|
|
108
108
|
`/api/health` as the health check. No persistent storage or keys are needed.
|
|
109
109
|
See [deployment instructions](docs/deployment.md). `npm start` remains the local
|
|
110
110
|
trading runtime and must not be used as the hosted container command.
|
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/docs/npm-release.md
CHANGED
|
@@ -6,19 +6,20 @@ the repository release configuration below.
|
|
|
6
6
|
|
|
7
7
|
## Workflows
|
|
8
8
|
|
|
9
|
-
| Workflow
|
|
10
|
-
|
|
|
11
|
-
| `npm-ci.yml`
|
|
12
|
-
| `npm-release.yml`
|
|
13
|
-
| `ci.yml`
|
|
14
|
-
| `
|
|
15
|
-
| `web-rollback.yml` | Restore the image from a successful main release without rebuilding or republishing npm |
|
|
9
|
+
| Workflow | Purpose |
|
|
10
|
+
| -------------------- | ----------------------------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| `npm-ci.yml` | Node 22.23.4 / 24.22.1 checks, Paper MCP smoke, tarball inspection and installed-production-package smoke |
|
|
12
|
+
| `npm-release.yml` | Revalidate the checkout, prepare a channel version, test the exact tarball, dry-run and optionally publish it with OIDC |
|
|
13
|
+
| `ci.yml` | Source Dockerfile and npm archive images tested independently as read-only, non-root public containers |
|
|
14
|
+
| `verify-railway.yml` | Verify the exact public source commit after Railway's GitHub deployment succeeds |
|
|
16
15
|
|
|
17
16
|
This follows Walrus Memory's separation of checks and release channels, adapted
|
|
18
17
|
for one package. `dev` publishes `X.Y.Z-dev.RUN.ATTEMPT` under `dev`; `main` uses
|
|
19
18
|
the source `X.Y.Z` and `latest`. Run/attempt suffixes avoid registry allocation races. Branch releases
|
|
20
19
|
are serialized; existing versions with different integrity fail rather than overwrite.
|
|
21
|
-
`dev` is the default development branch; `main` is used for stable releases and
|
|
20
|
+
`dev` is the default development branch; `main` is used for stable releases and
|
|
21
|
+
Railway's native GitHub deployment. Website source builds and npm publication
|
|
22
|
+
are independent; see [web operations](deployment.md).
|
|
22
23
|
|
|
23
24
|
## Validate locally
|
|
24
25
|
|
|
@@ -65,7 +66,8 @@ versions are immutable; rollback means selecting a prior version, not overwritin
|
|
|
65
66
|
npm can accept a publication while its security processing is still pending.
|
|
66
67
|
The separate, read-only registry verification job waits up to 15 minutes and
|
|
67
68
|
compares downloaded bytes with the tested archive. Re-run this job after a
|
|
68
|
-
processing delay; it does not repeat publication.
|
|
69
|
+
processing delay; it does not repeat publication. Railway's Wait for CI gate
|
|
70
|
+
waits for the publication workflow and the other push checks to finish.
|
|
69
71
|
|
|
70
72
|
Release jobs use GitHub-hosted runners and npm OIDC. Provenance is disabled for
|
|
71
73
|
this private source repository because npm does not support provenance from private
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cmdoss/agent-pass-plugin",
|
|
3
|
-
"version": "0.1.1",
|
|
3
|
+
"version": "0.1.2-dev.19.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",
|
|
9
|
+
"version": "0.1.2-dev.19.1",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@fastify/static": "10.1.10",
|
|
12
12
|
"@modelcontextprotocol/sdk": "1.32.2",
|
package/package.json
CHANGED