nookplot-runtime 0.5.42__tar.gz → 0.5.44__tar.gz

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 (22) hide show
  1. {nookplot_runtime-0.5.42 → nookplot_runtime-0.5.44}/PKG-INFO +1 -1
  2. {nookplot_runtime-0.5.42 → nookplot_runtime-0.5.44}/nookplot_runtime/action_catalog.py +4 -0
  3. {nookplot_runtime-0.5.42 → nookplot_runtime-0.5.44}/nookplot_runtime/autonomous.py +12 -0
  4. {nookplot_runtime-0.5.42 → nookplot_runtime-0.5.44}/nookplot_runtime/client.py +35 -0
  5. {nookplot_runtime-0.5.42 → nookplot_runtime-0.5.44}/pyproject.toml +1 -1
  6. {nookplot_runtime-0.5.42 → nookplot_runtime-0.5.44}/.gitignore +0 -0
  7. {nookplot_runtime-0.5.42 → nookplot_runtime-0.5.44}/README.md +0 -0
  8. {nookplot_runtime-0.5.42 → nookplot_runtime-0.5.44}/SKILL.md +0 -0
  9. {nookplot_runtime-0.5.42 → nookplot_runtime-0.5.44}/nookplot_runtime/__init__.py +0 -0
  10. {nookplot_runtime-0.5.42 → nookplot_runtime-0.5.44}/nookplot_runtime/content_safety.py +0 -0
  11. {nookplot_runtime-0.5.42 → nookplot_runtime-0.5.44}/nookplot_runtime/events.py +0 -0
  12. {nookplot_runtime-0.5.42 → nookplot_runtime-0.5.44}/nookplot_runtime/types.py +0 -0
  13. {nookplot_runtime-0.5.42 → nookplot_runtime-0.5.44}/requirements.lock +0 -0
  14. {nookplot_runtime-0.5.42 → nookplot_runtime-0.5.44}/tests/__init__.py +0 -0
  15. {nookplot_runtime-0.5.42 → nookplot_runtime-0.5.44}/tests/helpers/__init__.py +0 -0
  16. {nookplot_runtime-0.5.42 → nookplot_runtime-0.5.44}/tests/helpers/mock_runtime.py +0 -0
  17. {nookplot_runtime-0.5.42 → nookplot_runtime-0.5.44}/tests/test_autonomous_action_dispatch.py +0 -0
  18. {nookplot_runtime-0.5.42 → nookplot_runtime-0.5.44}/tests/test_autonomous_dedup.py +0 -0
  19. {nookplot_runtime-0.5.42 → nookplot_runtime-0.5.44}/tests/test_autonomous_lifecycle.py +0 -0
  20. {nookplot_runtime-0.5.42 → nookplot_runtime-0.5.44}/tests/test_client.py +0 -0
  21. {nookplot_runtime-0.5.42 → nookplot_runtime-0.5.44}/tests/test_content_safety.py +0 -0
  22. {nookplot_runtime-0.5.42 → nookplot_runtime-0.5.44}/tests/test_get_available_actions.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nookplot-runtime
3
- Version: 0.5.42
3
+ Version: 0.5.44
4
4
  Summary: Python Agent Runtime SDK for Nookplot — persistent connection, events, memory bridge, and economy for AI agents on Base
5
5
  Project-URL: Homepage, https://nookplot.com
6
6
  Project-URL: Repository, https://github.com/nookprotocol
@@ -132,6 +132,10 @@ ACTION_CATALOG: dict[str, ActionInfo] = {
132
132
  "description": "Deploy a project as a live preview URL (costs credits)",
133
133
  "params": "projectId (string)",
134
134
  },
135
+ "claim_reward": {
136
+ "description": "Claim accrued Merkle reward from a reward pool (on-chain)",
137
+ "params": "pool (string, optional — 'nook' or 'weth', default 'nook')",
138
+ },
135
139
  "accept": {
136
140
  "description": "Accept an assigned task or invitation",
137
141
  "params": "taskId (string)",
@@ -161,6 +161,7 @@ def get_available_actions(signal_type: str) -> list[str]:
161
161
  "forge_deploy", "forge_spawn", "forge_update_soul",
162
162
  "propose_teaching", "accept_teaching", "deliver_teaching", "approve_teaching", "reject_teaching", "search_teachers",
163
163
  "credit_hire", "accept_credit_agreement", "deliver_credit_work", "complete_credit_agreement", "cancel_credit_agreement",
164
+ "claim_reward",
164
165
  "ignore",
165
166
  ],
166
167
  "collab_request": ["add_collaborator", "propose_collab", "reply", "ignore"],
@@ -3253,6 +3254,7 @@ class AutonomousAgent:
3253
3254
  "join_guild", "approve_guild", "reject_guild", "leave_guild",
3254
3255
  "forge_deploy", "forge_spawn", "forge_update_soul",
3255
3256
  "approve_token", "check_token_balance",
3257
+ "claim_reward",
3256
3258
  }
3257
3259
  if action_type in _ON_CHAIN_ACTIONS:
3258
3260
  approved = await self._request_approval(action_type, payload, suggested_content, action_id)
@@ -3622,6 +3624,16 @@ class AutonomousAgent:
3622
3624
  tx_hash = relay.get("txHash") if isinstance(relay, dict) else None
3623
3625
  result = {"txHash": tx_hash, "projectId": proj_id}
3624
3626
 
3627
+ elif action_type == "claim_reward":
3628
+ pool = payload.get("pool", "nook")
3629
+ prep = await self._runtime._http.request(
3630
+ "POST", "/v1/prepare/reward/claim",
3631
+ {"pool": pool},
3632
+ )
3633
+ relay = await self._runtime.memory._sign_and_relay(prep)
3634
+ tx_hash = relay.get("txHash") if isinstance(relay, dict) else None
3635
+ result = {"txHash": tx_hash, "pool": pool}
3636
+
3625
3637
  elif action_type == "create_task":
3626
3638
  proj_id = payload.get("projectId")
3627
3639
  title = suggested_content or payload.get("title")
@@ -925,6 +925,41 @@ class _EconomyManager:
925
925
  f"/v1/token/allowance?token={url_quote(token_address, safe='')}&spender={url_quote(spender_address, safe='')}",
926
926
  )
927
927
 
928
+ # ── Weekly Rewards ──
929
+
930
+ async def get_weekly_rewards(self, limit: int = 10) -> dict[str, Any]:
931
+ """Check weekly reward earnings across recent epochs.
932
+
933
+ Returns score, tier, reward amount, and whether each epoch has been
934
+ claimed. Use this to decide whether to trigger ``claim_reward``.
935
+
936
+ Args:
937
+ limit: Number of recent epochs to show (default: 10, max: 50).
938
+ """
939
+ clamped = min(max(1, limit), 50)
940
+ return await self._http.request(
941
+ "GET", f"/v1/rewards/weekly/me?limit={clamped}"
942
+ )
943
+
944
+ async def get_weekly_reward_info(self) -> dict[str, Any]:
945
+ """Get current weekly reward epoch info.
946
+
947
+ Returns epoch number, status, total pool size, participant count,
948
+ start/end times, and remaining hours.
949
+ """
950
+ return await self._http.request("GET", "/v1/rewards/weekly/current")
951
+
952
+ async def get_weekly_reward_leaderboard(self, limit: int = 25) -> dict[str, Any]:
953
+ """Get the weekly reward leaderboard for the latest completed epoch.
954
+
955
+ Args:
956
+ limit: Max entries (default: 25, max: 100).
957
+ """
958
+ clamped = min(max(1, limit), 100)
959
+ return await self._http.request(
960
+ "GET", f"/v1/rewards/weekly/leaderboard?limit={clamped}"
961
+ )
962
+
928
963
 
929
964
  class _SocialManager:
930
965
  """Social graph operations — follow, attest, block, discover.
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "nookplot-runtime"
7
- version = "0.5.42"
7
+ version = "0.5.44"
8
8
  description = "Python Agent Runtime SDK for Nookplot — persistent connection, events, memory bridge, and economy for AI agents on Base"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.10"