@senpi/runtime 3.0.81 → 3.0.83

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.
Files changed (102) hide show
  1. package/dist/actions/decision-engine.d.ts +16 -0
  2. package/dist/actions/decision-engine.d.ts.map +1 -1
  3. package/dist/actions/decision-engine.js +137 -1
  4. package/dist/actions/decision-engine.js.map +1 -1
  5. package/dist/cli/guide-commands.d.ts.map +1 -1
  6. package/dist/cli/guide-commands.js +33 -0
  7. package/dist/cli/guide-commands.js.map +1 -1
  8. package/dist/cli/senpi-commands.d.ts.map +1 -1
  9. package/dist/cli/senpi-commands.js +12 -0
  10. package/dist/cli/senpi-commands.js.map +1 -1
  11. package/dist/cli/update-command.d.ts +70 -0
  12. package/dist/cli/update-command.d.ts.map +1 -0
  13. package/dist/cli/update-command.js +132 -0
  14. package/dist/cli/update-command.js.map +1 -0
  15. package/dist/dsl/plugin/index.d.ts +35 -1
  16. package/dist/dsl/plugin/index.d.ts.map +1 -1
  17. package/dist/dsl/plugin/index.js +62 -7
  18. package/dist/dsl/plugin/index.js.map +1 -1
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +87 -6
  21. package/dist/index.js.map +1 -1
  22. package/dist/runtime/effective-config.d.ts +67 -0
  23. package/dist/runtime/effective-config.d.ts.map +1 -0
  24. package/dist/runtime/effective-config.js +324 -0
  25. package/dist/runtime/effective-config.js.map +1 -0
  26. package/dist/runtime/lifecycle-events.d.ts +19 -0
  27. package/dist/runtime/lifecycle-events.d.ts.map +1 -1
  28. package/dist/runtime/lifecycle-events.js +27 -0
  29. package/dist/runtime/lifecycle-events.js.map +1 -1
  30. package/dist/runtime/rebuild-errors.d.ts +26 -0
  31. package/dist/runtime/rebuild-errors.d.ts.map +1 -0
  32. package/dist/runtime/rebuild-errors.js +36 -0
  33. package/dist/runtime/rebuild-errors.js.map +1 -0
  34. package/dist/runtime/run.d.ts +10 -0
  35. package/dist/runtime/run.d.ts.map +1 -1
  36. package/dist/runtime/run.js +13 -1
  37. package/dist/runtime/run.js.map +1 -1
  38. package/dist/runtime/runtime.d.ts +99 -1
  39. package/dist/runtime/runtime.d.ts.map +1 -1
  40. package/dist/runtime/runtime.js +321 -127
  41. package/dist/runtime/runtime.js.map +1 -1
  42. package/dist/runtime/update-apply-deps.d.ts +43 -0
  43. package/dist/runtime/update-apply-deps.d.ts.map +1 -0
  44. package/dist/runtime/update-apply-deps.js +62 -0
  45. package/dist/runtime/update-apply-deps.js.map +1 -0
  46. package/dist/runtime/update-handler.d.ts +158 -0
  47. package/dist/runtime/update-handler.d.ts.map +1 -0
  48. package/dist/runtime/update-handler.js +252 -0
  49. package/dist/runtime/update-handler.js.map +1 -0
  50. package/dist/runtime/update-plan.d.ts +60 -0
  51. package/dist/runtime/update-plan.d.ts.map +1 -0
  52. package/dist/runtime/update-plan.js +164 -0
  53. package/dist/runtime/update-plan.js.map +1 -0
  54. package/dist/runtime/update-register.d.ts +72 -0
  55. package/dist/runtime/update-register.d.ts.map +1 -0
  56. package/dist/runtime/update-register.js +146 -0
  57. package/dist/runtime/update-register.js.map +1 -0
  58. package/dist/runtime/update-report.d.ts +93 -0
  59. package/dist/runtime/update-report.d.ts.map +1 -0
  60. package/dist/runtime/update-report.js +133 -0
  61. package/dist/runtime/update-report.js.map +1 -0
  62. package/dist/skills-manager/manifest.d.ts.map +1 -1
  63. package/dist/skills-manager/manifest.js +1 -0
  64. package/dist/skills-manager/manifest.js.map +1 -1
  65. package/dist/skills-manager/skills-manifest.json +1 -0
  66. package/dist/utils/event-catalog.d.ts +26 -0
  67. package/dist/utils/event-catalog.d.ts.map +1 -1
  68. package/dist/utils/event-catalog.js +1 -0
  69. package/dist/utils/event-catalog.js.map +1 -1
  70. package/dist/widgets/errors.d.ts +3 -15
  71. package/dist/widgets/errors.d.ts.map +1 -1
  72. package/dist/widgets/errors.js +3 -20
  73. package/dist/widgets/errors.js.map +1 -1
  74. package/dist/widgets/index.d.ts +3 -10
  75. package/dist/widgets/index.d.ts.map +1 -1
  76. package/dist/widgets/index.js +3 -6
  77. package/dist/widgets/index.js.map +1 -1
  78. package/dist/widgets/registry.d.ts.map +1 -1
  79. package/dist/widgets/registry.js +10 -3
  80. package/dist/widgets/registry.js.map +1 -1
  81. package/dist/widgets/tool.d.ts +6 -9
  82. package/dist/widgets/tool.d.ts.map +1 -1
  83. package/dist/widgets/tool.js +37 -147
  84. package/dist/widgets/tool.js.map +1 -1
  85. package/dist/widgets/types.d.ts +20 -58
  86. package/dist/widgets/types.d.ts.map +1 -1
  87. package/dist/widgets/types.js +4 -4
  88. package/dist/widgets/widgets/fund-user-wallet.d.ts +4 -5
  89. package/dist/widgets/widgets/fund-user-wallet.d.ts.map +1 -1
  90. package/dist/widgets/widgets/fund-user-wallet.js +27 -67
  91. package/dist/widgets/widgets/fund-user-wallet.js.map +1 -1
  92. package/openclaw.plugin.json +1 -4
  93. package/package.json +2 -3
  94. package/dist/widgets/strategy-lookup.d.ts +0 -39
  95. package/dist/widgets/strategy-lookup.d.ts.map +0 -1
  96. package/dist/widgets/strategy-lookup.js +0 -70
  97. package/dist/widgets/strategy-lookup.js.map +0 -1
  98. package/dist/widgets/widgets/fund-strategy-wallet.d.ts +0 -13
  99. package/dist/widgets/widgets/fund-strategy-wallet.d.ts.map +0 -1
  100. package/dist/widgets/widgets/fund-strategy-wallet.js +0 -139
  101. package/dist/widgets/widgets/fund-strategy-wallet.js.map +0 -1
  102. package/skills/senpi-widgets/SKILL.md +0 -167
@@ -1,167 +0,0 @@
1
- ---
2
- name: senpi-widgets
3
- description: "Use the show_widget tool to render a native Senpi card in the chat instead of describing a flow in text. Use when the user has no funds, cannot open a trade for lack of balance, asks how to deposit, add money, fund their wallet, fund or top up a strategy — and whenever you are about to explain a Senpi flow that the app already has a screen for. Triggers on: fund wallet, add funds, deposit, no balance, insufficient balance, how do I put money in, top up, fund my strategy, strategy has no margin, show widget, show card, funding card."
4
- ---
5
-
6
- # Senpi widgets
7
-
8
- The Senpi web and mobile clients render cards from the `show_widget` tool call.
9
- Calling the tool puts a real, working card in the conversation. It is not a
10
- picture and not a description — the card's own button drives the product flow.
11
-
12
- ## The one tool
13
-
14
- ```
15
- show_widget(widget_type, <fields for that type>)
16
- ```
17
-
18
- `widget_type` is an enum. Pass only the fields the tool description lists for
19
- that type; anything else is rejected.
20
-
21
- ## Two wallets, two widgets
22
-
23
- There are two different wallets, and they are funded in two different ways.
24
-
25
- | | User wallet | Strategy wallet |
26
- |---|---|---|
27
- | Whose | The user's own Senpi (self-custody) wallet | One wallet per strategy |
28
- | How it is funded | External deposit — USDC sent to an address | Internal transfer from the user's own wallet |
29
- | Widget | `fund_user_wallet` | `fund_strategy_wallet` |
30
-
31
- Pick by the wallet the money is going *into*. If the user has no money in Senpi
32
- at all, that is `fund_user_wallet` — a strategy cannot be funded from an empty
33
- wallet.
34
-
35
- ## Widget types
36
-
37
- ### `fund_user_wallet`
38
-
39
- The card explains that Senpi wallets are self-custody and its button opens the
40
- deposit screen for the user's own wallet.
41
-
42
- Use it when:
43
-
44
- - the user has no balance, or too little balance to open the trade they asked for
45
- - the user asks how to deposit, add funds, or top up
46
- - you are about to explain the deposit flow in prose
47
-
48
- Fields:
49
-
50
- | Field | Required | Notes |
51
- |---|---|---|
52
- | `widget_type` | yes | `"fund_user_wallet"` |
53
- | `reason` | no | One plain sentence on why you are showing the card. Not displayed — the card owns its copy. Omit it rather than passing an empty string. |
54
-
55
- Worked example — the user says *"open a 5x long on HYPE"* and the account has
56
- no balance:
57
-
58
- ```
59
- show_widget({
60
- widget_type: "fund_user_wallet",
61
- reason: "Your wallet needs a balance before this trade can open."
62
- })
63
- ```
64
-
65
- Then answer in prose, for example: "Add funds from the card above and I'll open
66
- the 5x HYPE long straight after."
67
-
68
- Do not pass an address to this widget. The card resolves the user's own wallet
69
- from their session, and an address is rejected.
70
-
71
- ### `fund_strategy_wallet`
72
-
73
- The card's button moves money from the user's own Senpi wallet into one of their
74
- strategies. It is an internal transfer, so no address is ever shown or needed by
75
- the user.
76
-
77
- Use it when:
78
-
79
- - a strategy is out of margin, or too small to take the trade the user wants
80
- - the user asks to fund, top up or add to a named strategy
81
- - you are about to explain how to move money into a strategy in prose
82
-
83
- Fields:
84
-
85
- | Field | Required | Notes |
86
- |---|---|---|
87
- | `widget_type` | yes | `"fund_strategy_wallet"` |
88
- | `strategy_wallet` | yes | The `strategyWalletAddress` of one of the user's **ACTIVE** strategies. Get it from `strategy_list`; never from memory or from the user's typing. |
89
- | `tracking_id` | yes | A fresh UUID **you** generate for this one funding request. 8-128 characters, letters/digits/`.`/`_`/`-` only. |
90
- | `reason` | no | One plain sentence on why you are showing the card. Not displayed. |
91
-
92
- Worked example — the user says *"put another $200 into my HYPE momentum
93
- strategy"*. First call `strategy_list` to get that strategy's
94
- `strategyWalletAddress`, then:
95
-
96
- ```
97
- show_widget({
98
- widget_type: "fund_strategy_wallet",
99
- strategy_wallet: "0x1111111111111111111111111111111111111111",
100
- tracking_id: "0d2f4a1c-3b7e-4f0a-9c11-6ad2e5b8c701",
101
- reason: "The user wants to add $200 to this strategy."
102
- })
103
- ```
104
-
105
- The user chooses the amount on the card. Do not put an amount in the call.
106
-
107
- ## House rules
108
-
109
- **Show a card once per turn.** After the tool returns, the card is on screen.
110
- Answer every follow-up in text. Calling `show_widget` again in the same turn
111
- stacks duplicate cards in the transcript.
112
-
113
- **Never write a deposit address, QR code or network list in text.** The card and
114
- the deposit screen own those. A pasted address in chat is a phishing surface and
115
- can go stale.
116
-
117
- **Never give a deposit address for a strategy wallet — there is no such thing.**
118
- USDC sent straight to a strategy wallet skips Senpi's accounting, corrupts the
119
- strategy's PnL and may be unrecoverable. Funding a strategy is only ever the
120
- `fund_strategy_wallet` card. If a user asks where to send funds for a strategy,
121
- tell them it is an internal transfer and show the card.
122
-
123
- **Generate a new `tracking_id` for every `fund_strategy_wallet` call.** It is the
124
- idempotency key for the top-up. Reusing one from an earlier card replays that
125
- first top-up: the amount is whatever the user typed the first time, and nothing
126
- new is transferred. Never copy a tracking id out of the conversation.
127
-
128
- **Correct numbers when you talk about deposits in prose:** for a deposit into the
129
- user's own wallet the minimum is $10, and most traders start with $100-250. Do
130
- not invent other figures — the deposit card's own copy uses these. These are
131
- deposit figures; do not quote them for a strategy top-up.
132
-
133
- **Do not claim the deposit landed.** The tool result only says the card was
134
- shown. Wait for the user to say so, or for the client's own "I've funded my
135
- wallet" message, before acting as though there is a balance.
136
-
137
- **Do not ask the user to confirm before showing a card.** Showing it costs
138
- nothing and authorizes nothing.
139
-
140
- ## When the tool returns an error
141
-
142
- The error names the exact fields that were wrong: missing, invalid, or
143
- unexpected. Fix those fields and call `show_widget` again. Keep the same
144
- `widget_type` unless the error itself names a different one. Dropping the call
145
- and describing the flow in prose instead is the wrong recovery.
146
-
147
- - `unexpected fields: amount` — that widget takes no amount. Remove the field.
148
- - `invalid fields: reason (must be a non-empty string; omit it instead)` — drop
149
- `reason` entirely, or pass a real sentence.
150
- - `unknown widget_type "..."` — the message lists the available types. Pick one
151
- of those; do not invent a name.
152
- - `... is not one of your strategy wallets` — call `strategy_list` and use a
153
- `strategyWalletAddress` from it. Do not retry the same address.
154
- - `whose status is PAUSED, not ACTIVE` — only a live strategy can be funded. Tell
155
- the user, or pass a different strategy's wallet.
156
- - `it takes no address` on `fund_user_wallet` — drop `strategy_wallet`, or switch
157
- to `fund_strategy_wallet` if the money is meant for a strategy.
158
- - `tracking_id must be 8-128 characters ...` — generate a fresh UUID and call
159
- again with everything else unchanged.
160
-
161
- **"could not be verified — the Senpi backend did not answer"** is different from
162
- every error above: nothing was found wrong with your call. Retry the *same* call,
163
- tracking id included — no card rendered, so that id is still unused. Do not swap
164
- the address, and do not tell the user their strategy does not exist.
165
-
166
- If a widget type is reported as not enabled on this deployment, do not retry it.
167
- Handle the request in prose instead.