@senpi/runtime 3.0.72 → 3.0.74
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/cli/senpi-commands.d.ts.map +1 -1
- package/dist/cli/senpi-commands.js +6 -5
- package/dist/cli/senpi-commands.js.map +1 -1
- package/dist/deploy/deadlines.d.ts +61 -1
- package/dist/deploy/deadlines.d.ts.map +1 -1
- package/dist/deploy/deadlines.js +85 -2
- package/dist/deploy/deadlines.js.map +1 -1
- package/dist/deploy/funding.d.ts +38 -0
- package/dist/deploy/funding.d.ts.map +1 -1
- package/dist/deploy/funding.js +39 -0
- package/dist/deploy/funding.js.map +1 -1
- package/dist/deploy/job.d.ts.map +1 -1
- package/dist/deploy/job.js +7 -1
- package/dist/deploy/job.js.map +1 -1
- package/dist/deploy/messages.d.ts +603 -0
- package/dist/deploy/messages.d.ts.map +1 -0
- package/dist/deploy/messages.js +1388 -0
- package/dist/deploy/messages.js.map +1 -0
- package/dist/deploy/orchestrator.d.ts +8 -0
- package/dist/deploy/orchestrator.d.ts.map +1 -1
- package/dist/deploy/orchestrator.js +146 -1211
- package/dist/deploy/orchestrator.js.map +1 -1
- package/dist/deploy/package.d.ts +89 -0
- package/dist/deploy/package.d.ts.map +1 -1
- package/dist/deploy/package.js +213 -25
- package/dist/deploy/package.js.map +1 -1
- package/dist/deploy/proof-gate.d.ts +4 -0
- package/dist/deploy/proof-gate.d.ts.map +1 -1
- package/dist/deploy/proof-gate.js +4 -0
- package/dist/deploy/proof-gate.js.map +1 -1
- package/dist/deploy/recheck-commands.d.ts.map +1 -1
- package/dist/deploy/recheck-commands.js +21 -3
- package/dist/deploy/recheck-commands.js.map +1 -1
- package/dist/deploy/register.d.ts +2 -0
- package/dist/deploy/register.d.ts.map +1 -1
- package/dist/deploy/register.js +23 -6
- package/dist/deploy/register.js.map +1 -1
- package/dist/deploy/taxonomy.d.ts +19 -0
- package/dist/deploy/taxonomy.d.ts.map +1 -1
- package/dist/deploy/taxonomy.js +28 -0
- package/dist/deploy/taxonomy.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +230 -176
- package/dist/index.js.map +1 -1
- package/dist/runtime/env-resolve.d.ts +13 -0
- package/dist/runtime/env-resolve.d.ts.map +1 -1
- package/dist/runtime/env-resolve.js +14 -1
- package/dist/runtime/env-resolve.js.map +1 -1
- package/dist/runtime/runtime-schema.d.ts +100 -100
- package/dist/scanners/external/scaffold/preflight.py +39 -0
- package/dist/telemetry/metrics.d.ts +7 -0
- package/dist/telemetry/metrics.d.ts.map +1 -1
- package/dist/telemetry/metrics.js +7 -0
- package/dist/telemetry/metrics.js.map +1 -1
- package/dist/validate/codes.d.ts +10 -0
- package/dist/validate/codes.d.ts.map +1 -1
- package/dist/validate/codes.js +38 -1
- package/dist/validate/codes.js.map +1 -1
- package/dist/validate/live-stage.d.ts +8 -0
- package/dist/validate/live-stage.d.ts.map +1 -1
- package/dist/validate/live-stage.js +87 -18
- package/dist/validate/live-stage.js.map +1 -1
- package/dist/validate/package-gates-stage.d.ts +61 -0
- package/dist/validate/package-gates-stage.d.ts.map +1 -0
- package/dist/validate/package-gates-stage.js +215 -0
- package/dist/validate/package-gates-stage.js.map +1 -0
- package/dist/validate/run.d.ts +24 -1
- package/dist/validate/run.d.ts.map +1 -1
- package/dist/validate/run.js +51 -4
- package/dist/validate/run.js.map +1 -1
- package/dist/validate/taxonomy-finding.d.ts +22 -0
- package/dist/validate/taxonomy-finding.d.ts.map +1 -0
- package/dist/validate/taxonomy-finding.js +25 -0
- package/dist/validate/taxonomy-finding.js.map +1 -0
- package/dist/validate/universe-stage.d.ts.map +1 -1
- package/dist/validate/universe-stage.js +2 -20
- package/dist/validate/universe-stage.js.map +1 -1
- package/dist/validate/wallet-binding-stage.d.ts +44 -0
- package/dist/validate/wallet-binding-stage.d.ts.map +1 -0
- package/dist/validate/wallet-binding-stage.js +92 -0
- package/dist/validate/wallet-binding-stage.js.map +1 -0
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Does this recipe bind the wallet its package says it binds?
|
|
3
|
+
*
|
|
4
|
+
* Deploy's pre-money check, run here too — the SAME `unboundWalletInstances` `runDeploy` calls, not
|
|
5
|
+
* a second implementation. The author should never first learn about a package-derivable fault from
|
|
6
|
+
* the money path, which is what `senpi validate` green followed by `senpi deploy` refused means.
|
|
7
|
+
*
|
|
8
|
+
* ## Why this is a STATIC-depth check
|
|
9
|
+
*
|
|
10
|
+
* It reads the package's own bytes and nothing else: no exchange, no gateway, no credentials. That
|
|
11
|
+
* puts it at the shallowest depth, where `depthsUpTo` makes it run at every depth above — so an
|
|
12
|
+
* offline CI run with no MCP server reachable still catches it. The universe check next door is
|
|
13
|
+
* live-depth only because its verdict needs the exchange's instrument list; this one has no such
|
|
14
|
+
* excuse and should not borrow the latency.
|
|
15
|
+
*
|
|
16
|
+
* ## Why it never fires on a recipe an author is pinning deliberately
|
|
17
|
+
*
|
|
18
|
+
* `resolveWallet` accepts a well-formed address in `strategy.wallet` as a real wallet to validate
|
|
19
|
+
* against — pinning is how you make a live run read a real book instead of the empty placeholder
|
|
20
|
+
* one. That is a supported workflow and this check must not take it away. It cannot: the fault
|
|
21
|
+
* requires a manifest that declares `wallet_env` for THIS instance, which is exactly the state
|
|
22
|
+
* where a pinned address contradicts the package's own promise. A recipe with no package around it,
|
|
23
|
+
* or one the manifest does not declare, is silent here.
|
|
24
|
+
*
|
|
25
|
+
* ## The three states of "no package"
|
|
26
|
+
*
|
|
27
|
+
* Same rule as `universe-stage.ts`, for the same reason. `pkg` set is the checkable one.
|
|
28
|
+
* `packageUnreadable` means a `strategy.yaml` exists and would not load — the check could not run,
|
|
29
|
+
* which is reported rather than passed over, because "I could not read it" is never "there is
|
|
30
|
+
* nothing there". Neither set is the genuine no-package case (a recipe being authored before its
|
|
31
|
+
* manifest exists), and nothing is reported there.
|
|
32
|
+
*/
|
|
33
|
+
import type { ResolvedTarget } from "./target.js";
|
|
34
|
+
import type { Finding } from "./types.js";
|
|
35
|
+
/**
|
|
36
|
+
* The check, as findings.
|
|
37
|
+
*
|
|
38
|
+
* Scoped to the instance this run is validating, not to the whole package. `target.ts` resolves a
|
|
39
|
+
* package ROOT to a refusal ("pick an instance"), so every run that gets here is about exactly one
|
|
40
|
+
* recipe — and reporting a sibling's fault would be telling the author to edit a file this command
|
|
41
|
+
* did not look at.
|
|
42
|
+
*/
|
|
43
|
+
export declare function walletBindingFindings(target: ResolvedTarget): Finding[];
|
|
44
|
+
//# sourceMappingURL=wallet-binding-stage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallet-binding-stage.d.ts","sourceRoot":"","sources":["../../src/validate/wallet-binding-stage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,EAAE,CAgBvE"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Does this recipe bind the wallet its package says it binds?
|
|
3
|
+
*
|
|
4
|
+
* Deploy's pre-money check, run here too — the SAME `unboundWalletInstances` `runDeploy` calls, not
|
|
5
|
+
* a second implementation. The author should never first learn about a package-derivable fault from
|
|
6
|
+
* the money path, which is what `senpi validate` green followed by `senpi deploy` refused means.
|
|
7
|
+
*
|
|
8
|
+
* ## Why this is a STATIC-depth check
|
|
9
|
+
*
|
|
10
|
+
* It reads the package's own bytes and nothing else: no exchange, no gateway, no credentials. That
|
|
11
|
+
* puts it at the shallowest depth, where `depthsUpTo` makes it run at every depth above — so an
|
|
12
|
+
* offline CI run with no MCP server reachable still catches it. The universe check next door is
|
|
13
|
+
* live-depth only because its verdict needs the exchange's instrument list; this one has no such
|
|
14
|
+
* excuse and should not borrow the latency.
|
|
15
|
+
*
|
|
16
|
+
* ## Why it never fires on a recipe an author is pinning deliberately
|
|
17
|
+
*
|
|
18
|
+
* `resolveWallet` accepts a well-formed address in `strategy.wallet` as a real wallet to validate
|
|
19
|
+
* against — pinning is how you make a live run read a real book instead of the empty placeholder
|
|
20
|
+
* one. That is a supported workflow and this check must not take it away. It cannot: the fault
|
|
21
|
+
* requires a manifest that declares `wallet_env` for THIS instance, which is exactly the state
|
|
22
|
+
* where a pinned address contradicts the package's own promise. A recipe with no package around it,
|
|
23
|
+
* or one the manifest does not declare, is silent here.
|
|
24
|
+
*
|
|
25
|
+
* ## The three states of "no package"
|
|
26
|
+
*
|
|
27
|
+
* Same rule as `universe-stage.ts`, for the same reason. `pkg` set is the checkable one.
|
|
28
|
+
* `packageUnreadable` means a `strategy.yaml` exists and would not load — the check could not run,
|
|
29
|
+
* which is reported rather than passed over, because "I could not read it" is never "there is
|
|
30
|
+
* nothing there". Neither set is the genuine no-package case (a recipe being authored before its
|
|
31
|
+
* manifest exists), and nothing is reported there.
|
|
32
|
+
*/
|
|
33
|
+
import { isAbsolute, relative } from "node:path";
|
|
34
|
+
import { unboundWalletInstances } from "../deploy/package.js";
|
|
35
|
+
import { VALIDATE_CODE } from "./codes.js";
|
|
36
|
+
import { taxonomyFinding } from "./taxonomy-finding.js";
|
|
37
|
+
/**
|
|
38
|
+
* The check, as findings.
|
|
39
|
+
*
|
|
40
|
+
* Scoped to the instance this run is validating, not to the whole package. `target.ts` resolves a
|
|
41
|
+
* package ROOT to a refusal ("pick an instance"), so every run that gets here is about exactly one
|
|
42
|
+
* recipe — and reporting a sibling's fault would be telling the author to edit a file this command
|
|
43
|
+
* did not look at.
|
|
44
|
+
*/
|
|
45
|
+
export function walletBindingFindings(target) {
|
|
46
|
+
if (target.packageUnreadable !== undefined) {
|
|
47
|
+
// Deliberately silent. The manifest is what declares `wallet_env`, so an unreadable one means
|
|
48
|
+
// this check has no question to ask — and `target.ts` already raises
|
|
49
|
+
// `E_VALIDATE_UNREADABLE_MANIFEST` at the package root, while below the root the universe check
|
|
50
|
+
// reports the same unreadable file. A third voice on one fault is noise, not fail-open: no
|
|
51
|
+
// reading of a manifest nobody can read could clear a package for funding.
|
|
52
|
+
return [];
|
|
53
|
+
}
|
|
54
|
+
const pkg = target.pkg;
|
|
55
|
+
if (pkg === undefined || target.recipePath === undefined)
|
|
56
|
+
return [];
|
|
57
|
+
const fault = unboundWalletInstances(pkg).find((candidate) => candidate.instance.runtimeYamlPath === target.recipePath);
|
|
58
|
+
return fault === undefined ? [] : [walletUnboundFinding(fault, pkg)];
|
|
59
|
+
}
|
|
60
|
+
function walletUnboundFinding(fault, pkg) {
|
|
61
|
+
const file = asPath(pkg.dir, fault.instance.runtimeYamlPath);
|
|
62
|
+
const binds = fault.declared === undefined
|
|
63
|
+
? "declares no `strategy.wallet` at all"
|
|
64
|
+
: `binds \`strategy.wallet: ${fault.declared}\``;
|
|
65
|
+
return taxonomyFinding(VALIDATE_CODE.walletUnbound, {
|
|
66
|
+
where: { file, yaml_path: "strategy.wallet" },
|
|
67
|
+
what: `This recipe ${binds}, but strategy.yaml declares \`wallet_env: ${fault.instance.walletEnv}\` ` +
|
|
68
|
+
`for instance "${fault.instance.name}"`,
|
|
69
|
+
why: "`senpi deploy` creates and funds a wallet for this instance and passes it in by substituting " +
|
|
70
|
+
`\`${fault.expected}\` into this file. Nothing here carries that token, so nothing would be ` +
|
|
71
|
+
"substituted — silently, because the unresolved-placeholder check only looks for `${...}` " +
|
|
72
|
+
"left over. The deploy would fund a new wallet and then install this strategy, exit engine " +
|
|
73
|
+
"included, against a different account: the funded wallet left with nothing watching it, and " +
|
|
74
|
+
"the install reporting the address in this file.",
|
|
75
|
+
fix: `Set \`strategy.wallet\` in ${file} to \`"${fault.expected}"\`. Deploy substitutes the wallet ` +
|
|
76
|
+
`it creates; a literal address is never what you want for an instance the manifest funds. ` +
|
|
77
|
+
`\`senpi deploy\` reads the same two files and refuses for the same reason.`,
|
|
78
|
+
evidence: {
|
|
79
|
+
instance: fault.instance.name,
|
|
80
|
+
wallet_env: fault.instance.walletEnv,
|
|
81
|
+
expected: fault.expected,
|
|
82
|
+
declared: fault.declared,
|
|
83
|
+
file,
|
|
84
|
+
},
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/** Package-relative where it sits underneath, absolute otherwise — as `universe-stage.ts` renders. */
|
|
88
|
+
function asPath(base, absolute) {
|
|
89
|
+
const rel = relative(base, absolute);
|
|
90
|
+
return rel === "" || rel.startsWith("..") || isAbsolute(rel) ? absolute : rel;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=wallet-binding-stage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallet-binding-stage.js","sourceRoot":"","sources":["../../src/validate/wallet-binding-stage.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAA+C,MAAM,sBAAsB,CAAC;AAC3G,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAGxD;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CAAC,MAAsB;IAC1D,IAAI,MAAM,CAAC,iBAAiB,KAAK,SAAS,EAAE,CAAC;QAC3C,8FAA8F;QAC9F,qEAAqE;QACrE,gGAAgG;QAChG,2FAA2F;QAC3F,2EAA2E;QAC3E,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;IACvB,IAAI,GAAG,KAAK,SAAS,IAAI,MAAM,CAAC,UAAU,KAAK,SAAS;QAAE,OAAO,EAAE,CA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AAQ,EAAE,KAAK,CAAC,QAAQ;YACxB,IAAI;SACL;KACF,CAAC,CAAC;AACL,CAAC;AAED,sGAAsG;AACtG,SAAS,MAAM,CAAC,IAAY,EAAE,QAAgB;IAC5C,MAAM,GAAG,GAAG,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACrC,OAAO,GAAG,KAAK,EAAE,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC;AAChF,CAAC"}
|
package/openclaw.plugin.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"id": "runtime",
|
|
3
3
|
"name": "Senpi Runtime",
|
|
4
4
|
"description": "Senpi runtime plugin for OpenClaw. Orchestrates scanners, LLM-based trade decisions, and a DSL trailing stop-loss exit engine.",
|
|
5
|
-
"version": "3.0.
|
|
5
|
+
"version": "3.0.74",
|
|
6
6
|
"commandAliases": [
|
|
7
7
|
{
|
|
8
8
|
"name": "senpi"
|