Skip to content

v1.1.0#80

Open
vieiraricardo wants to merge 83 commits intomainfrom
releases/v1.1.0
Open

v1.1.0#80
vieiraricardo wants to merge 83 commits intomainfrom
releases/v1.1.0

Conversation

@vieiraricardo
Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI and others added 30 commits September 1, 2025 18:24
Co-authored-by: mickeyjoes <10925516+mickeyjoes@users.noreply.github.com>
…ve tests

Co-authored-by: mickeyjoes <10925516+mickeyjoes@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Create chain-config.ts with contract addresses for multiple chains including Rollux Mainnet (0x2aACce8B9522F81F14834883198645BB6894Bfc0)
- Make airdrop parameter optional in PushPrepareOptions, auto-resolve from token.chainId
- Add comprehensive chain metadata and helper functions
- Add extensive tests for multi-chain functionality
- Export new chain configuration functions from payouts module

Co-authored-by: mickeyjoes <10925516+mickeyjoes@users.noreply.github.com>
Co-authored-by: mickeyjoes <10925516+mickeyjoes@users.noreply.github.com>
Add CSV and canonical JSON exporters for PayoutManifest
Implement Payouts Tx-Preparer with Multi-Chain Support: ERC-20 approve + batchTokenTransfer; native funding + batchNativeTransfer
Co-authored-by: mickeyjoes <10925516+mickeyjoes@users.noreply.github.com>
Co-authored-by: mickeyjoes <10925516+mickeyjoes@users.noreply.github.com>
… reconcile module

Co-authored-by: mickeyjoes <10925516+mickeyjoes@users.noreply.github.com>
Implement payouts execute and reconcile helpers with viem WalletClient/PublicClient integration and extractAddressFromTopic utility
- Added exporters, tx-preparer, execute, and reconcile modules to payouts
- Updated src/payouts/index.ts to export all modules (types, builder, exporters, tx-preparer, execute, reconcile)
- Main src/index.ts already had payouts exports in place
- Added comprehensive integration test exercising full flow: buildManifest → toCSV → preparePushTxs → executeTxPlan → reconcilePush
- Fixed module format mismatch by removing "type": "module" from package.json
- All tests pass including payouts integration tests

Co-authored-by: mickeyjoes <10925516+mickeyjoes@users.noreply.github.com>
…th viem support

Co-authored-by: mickeyjoes <10925516+mickeyjoes@users.noreply.github.com>
…icts

Co-authored-by: mickeyjoes <10925516+mickeyjoes@users.noreply.github.com>
Integrate production-ready payouts module with viem blockchain support and resolve conflicts
Co-authored-by: mickeyjoes <10925516+mickeyjoes@users.noreply.github.com>
Build/test validation (superdapp-js, branch releases/v1.1.0)

TypeScript compile: PASS (dist present)
Jest: 18 suites, 151 tests PASS (payouts builder/exporters/tx-preparer/execute/reconcile + integration)
Fixed Jest config conflict by pinning test script to jest.config.js
Payouts readiness

Verified payouts re-export from index.ts and dist index (buildManifest, preparePushTxs, executeTxPlan, reconcilePush, toCSV/JSON)
Added payouts.md (push-only scope, APIs, constraints)
Commented and updated EPIC #23 to reference payouts.md (no “projects/*” dependency)
AI EPIC self-containment + scaffolding

Added ai-integration.md (adapter approach, envs, quick start notes)
Added AI module scaffold (no external deps yet, non-breaking):
types.ts (AiConfig, options)
client.ts (generateText/streamText/runAgent stubs with safe outputs)
index.ts and root export
Linked docs in README.md
Updated EPIC #35 to reference ai-integration.md (removed “projects/*” reference)
Example added: ai-basic-openai.ts (uses future generateText; compiles after full AI integration)
Files changed
Added: payouts.md, ai-integration.md
Added: types.ts, client.ts, index.ts
Updated: index.ts (export AI), README.md (links)
Updated: package.json test scripts to use explicit Jest config
Kept: existing Jest config (jest.config.js) and tests intact
Status
Build: PASS
Tests: PASS
Lint: No blocking errors (warnings only)
Issues: EPIC #23 and #35 now self-contained (refer to in-repo docs)
What’s next
Implement AI issues in order:
#36: Add deps (@openai/agents, @openai/agents-extensions, ai, @ai-sdk/openai) and AI module wiring
#37: Config loader (env → model)
#38: Client functions (generateText, streamText, runAgent) using adapters
Optional: add an executed example after #36#38.
Requirements coverage:

Payouts build/test verify: Done
Fix build blocker (viem): Done (already present, build passes)
Issues self-contained (no “projects/*”): Done
AI execution plan and scaffolding: Done (deps/impl pending per issues)
Co-authored-by: mickeyjoes <10925516+mickeyjoes@users.noreply.github.com>
Co-authored-by: mickeyjoes <10925516+mickeyjoes@users.noreply.github.com>
mickeyjoes and others added 12 commits January 5, 2026 20:42
The ESNext module configuration broke the CLI because:
1. package.json had 'type: module' which tells Node.js to treat .js as ESM
2. With moduleResolution: bundler, TypeScript doesn't add .js extensions
3. Node.js ES modules require explicit .js extensions for relative imports

This reverts to CommonJS which:
- Works correctly with the CLI (Node.js)
- Still works with Cloudflare Workers (bundler handles CommonJS)

Changes:
- Remove 'type: module' from package.json
- Set module: CommonJS in tsconfig.json
- Set moduleResolution: node in tsconfig.json
…ibility

- Add edge-client.ts with fetch-based AI client that works in workerd
- Support for OpenAI and Anthropic providers
- Handle max_tokens vs max_completion_tokens for newer models (gpt-4o, gpt-5, o1, o3)
- Add image generation support via OpenAI's image API
- Export EdgeAIClient from main SDK index
- Add DOM lib to tsconfig for fetch/AbortController types
…/o4)

Reasoning models (o1, o3, o4-mini, etc.) don't support custom temperature values.
Only the default (1) value is supported. Updated callOpenAI() to detect these
models and omit the temperature parameter.
gpt-5-mini and other gpt-5 variants also don't support custom temperature values.
Updated isReasoningModel to include gpt-5 prefix.
…ration

- Export AI client functions from main SDK entry point
- Add 'system' prompt support to generateText options
- Add 'maxOutputTokens' parameter support
- Export loadModel and AI config utilities
- SDK now provides unified AI interface wrapping Vercel AI SDK
- Check for output_text field (used by some gpt-5 models)
- Add better debug logging for empty responses
- Log response structure when content is empty
- Fix loadModel function that was returning empty string instead of loading from env
- Update all test imports from ../../llm/ to ../../ai-service/
- Update loadModel tests to verify native AI SDK v5 model structure
- Remove outdated tests that expected wrapped custom objects
- Add DOM globals (AbortController, AbortSignal, clearTimeout) to ESLint config
- Remove unused imports (Transport, Account) from web3-client.ts
- Remove unused variable (response) from wallet/bridge.ts
Copilot AI review requested due to automatic review settings April 8, 2026 18:29
@vieiraricardo vieiraricardo linked an issue Apr 8, 2026 that may be closed by this pull request
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Release v1.1.0 expands the SDK with payouts execution/reconciliation utilities, introduces model-agnostic AI integration (plus optional OpenAI Agents workflows), and adds new examples/docs/tests—along with improved runtime compatibility (e.g., Cloudflare Workers).

Changes:

  • Added payouts submodules (execute/reconcile/exporters/chain config) and expanded payouts re-exports.
  • Added AI service layer + agent AI client integration and CLI configuration flags.
  • Added new examples (Cloudflare super-group starter, AI examples, payouts example), documentation updates, and broader Jest coverage.

Reviewed changes

Copilot reviewed 87 out of 111 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
src/payouts/reconcile.ts Adds receipt/log-based reconciliation utilities for payout verification.
src/payouts/index.ts Expands payouts public exports/re-exports for easier consumption.
src/payouts/exporters.ts Adds CSV + canonical JSON exporters for payout manifests.
src/payouts/execute.ts Adds viem-based transaction plan execution helpers (with optional RPC config).
src/payouts/chain-config.ts Adds multi-chain metadata + Rollux RPC/explorer helpers and contract address registry.
src/payouts/builder.ts Uses viem checksumming + extends manifest schema with totals.
src/index.ts Adds wallet + AI exports at package root.
src/core/client.ts Adds fetch-based transport path (Cloudflare Workers) + new DM helper APIs.
src/core/agent.ts Adds AI client lazy-loading + improved message formatting and channel support.
src/cli/commands/configure.ts Adds CLI AI configuration options and config output changes.
src/ai-service/types.ts Introduces AI types for provider/model/config and client options.
src/ai-service/providers/openai-agents.ts Adds wrapper provider around @openai/agents with graceful missing-module handling.
src/ai-service/index.ts Adds AI module entrypoint + exports config/client/enhanced/edge features.
src/ai-service/config.ts Adds zod-validated AI config loader + provider model factory.
src/ai-service/client.ts Adds high-level AI helpers (generateText/streamText/runAgent) built on Vercel AI SDK.
src/tests/webhook-command.test.ts Adds webhook command dispatch edge case tests.
src/tests/wallet/bridge.test.ts Adds wallet bridge tests (polling, approvals, errors, events).
src/tests/utils/helpers.test.ts Adds tests for extractAddressFromTopic.
src/tests/payouts/web3-client.test.ts Adds tests for payout web3 client/RPC utilities.
src/tests/payouts/exporters.test.ts Adds tests for payouts exporters (CSV/JSON determinism).
src/tests/payouts/execute.test.ts Adds tests for payouts execution behavior.
src/tests/payouts.test.ts Updates payouts type tests to include new manifest totals field.
src/tests/payouts-integration.test.ts Adds end-to-end payouts flow integration test (build→export→prepare→execute→reconcile).
src/tests/ai.test.ts Adds basic AI module export/type tests.
src/tests/ai-service/openai-agents-provider.test.ts Adds tests for OpenAI Agents provider wrapper behavior.
src/tests/ai-service/client.test.ts Adds tests for AI client wrappers around Vercel AI SDK + Agents.
src/tests/ai-service/cli-env.test.ts Adds tests for env/CLI AI config integration/validation.
src/tests/ai-service/agent-integration.test.ts Adds tests for SuperDappAgent AI lazy-loading and usage.
pnpm-workspace.yaml Removes ignored built dependency configuration.
package.json Bumps version to 1.1.0 and adds AI + viem dependencies; adjusts Jest scripts.
jest.config.ts Adds placeholder to avoid duplicate Jest config usage.
examples/super-group-starter/wrangler.toml Adds Cloudflare Worker example configuration + D1 + cron.
examples/super-group-starter/utils/room.ts Adds shared room/channel helpers for Worker example.
examples/super-group-starter/tsconfig.json Adds TS config for super-group starter example.
examples/super-group-starter/scripts/start-ngrok-static.sh Adds static-domain ngrok helper script for local webhook dev.
examples/super-group-starter/package.json Adds standalone example package metadata and scripts.
examples/super-group-starter/migrations/001_group_configs.sql Adds D1 schema migration for group configuration persistence.
examples/super-group-starter/index.ts Adds placeholder entry (Cloudflare-only example).
examples/super-group-starter/SOCIAL.md Adds release/social announcement copy for the new example.
examples/super-group-starter/README.md Documents Worker setup, D1, commands, cron, deployment, and tunnels.
examples/super-group-starter/.gitignore Adds example-specific ignores (vars, build output, wrangler artifacts).
examples/super-group-starter/.env.example Adds example env template.
examples/super-group-starter/.dev.vars.example Adds wrangler dev vars template.
examples/payouts/tsconfig.json Adds TS config for payouts example.
examples/payouts/package.json Adds standalone payouts example project metadata + scripts.
examples/payouts/README.md Adds comprehensive payouts example documentation.
examples/payouts/.env.example Adds payouts env template (RPCs, keys, addresses).
examples/basic/.env.example Adds env template for basic example.
examples/ai/multi-provider/tsconfig.json Adds TS config for multi-provider AI example.
examples/ai/multi-provider/package.json Adds standalone multi-provider AI example project metadata.
examples/ai/multi-provider/README.md Documents multi-provider AI example usage and switching.
examples/ai/multi-provider/.env.example Adds env template for multi-provider AI example.
examples/ai/enhanced-features/tsconfig.json Adds TS config for enhanced AI features example.
examples/ai/enhanced-features/package.json Adds standalone enhanced AI features example project metadata.
examples/ai/enhanced-features/README.md Documents guardrails/streaming/tracing/enhanced features example.
examples/ai/enhanced-features/.env.example Adds env template for enhanced AI example.
examples/ai/basic-openai/tsconfig.json Adds TS config for basic OpenAI example.
examples/ai/basic-openai/package.json Adds standalone basic OpenAI example project metadata.
examples/ai/basic-openai/README.md Documents basic OpenAI example commands and setup.
examples/ai/basic-openai/.env.example Adds env template for basic OpenAI example.
examples/ai/anthropic-chat/tsconfig.json Adds TS config for Anthropic example.
examples/ai/anthropic-chat/package.json Adds standalone Anthropic example project metadata.
examples/ai/anthropic-chat/README.md Documents Anthropic chat/analysis example commands and setup.
examples/ai/anthropic-chat/.env.example Adds env template for Anthropic example.
examples/ai/README.md Adds AI examples index/overview documentation.
examples/advanced/ai-basic-openai.ts Adds advanced example showing root generateText import usage.
examples/advanced/.env.example Adds env template for advanced example.
examples/README.md Updates examples index to include AI examples and updated descriptions.
eslint.config.js Adds missing globals (AbortController/Signal, clearTimeout) for linting.
docs/quick-start.md Expands quick start with platform setup + webhook configuration + deployment notes.
docs/payouts.md Adds payouts documentation overview and key APIs.
docs/ai-configuration.md Adds AI provider configuration documentation and API reference.
docs/README.md Updates docs hub to include payouts + AI docs and platform setup pointer.
README.md Updates root README with AI dependency guidance and AI usage examples.
Files not reviewed (2)
  • examples/ai/anthropic-chat/package-lock.json: Language not supported
  • examples/ai/basic-openai/package-lock.json: Language not supported

Comment thread src/cli/commands/configure.ts
Comment thread src/payouts/reconcile.ts
Comment thread src/payouts/reconcile.ts
Comment thread src/core/agent.ts
Comment thread src/core/client.ts
Comment thread src/ai-service/index.ts Outdated
Comment thread src/ai-service/client.ts Outdated
Comment thread src/ai-service/client.ts
Comment thread package.json
Comment thread src/payouts/builder.ts Outdated
Fixes 11 issues identified in Copilot's code review:

1. **configure.ts** - Return apiToken and apiUrl from getConfiguration
   - Previously only returned AI fields, breaking env file writing

2. **reconcile.ts** - Use airdrop parameter to filter logs
   - Prevents false positives from unrelated ERC-20 Transfer events

3. **reconcile.ts** - Update quickReconcileCheck docstring
   - Reflects actual behavior (checks totals, recipients, and errors)

4. **agent.ts** - Throw error instead of empty string for unknown roomId
   - Prevents invalid API calls with malformed endpoints

5. **client.ts** - Add backward compatibility for updateConnectionMessage
   - Accepts both legacy format (string | { body: string }) and new SendMessageOptions

6. **index.ts** - Remove value import for type-only symbol
   - Changed from import to proper type-only usage

7. **ai-service/index.ts** - Unify AIConfig type definitions
   - Removed duplicate/conflicting AIConfig types

8. **client.ts** - Remove static loadModel import, use dynamic consistently
   - Ensures proper lazy loading across all functions

9. **builder.ts** - Replace require('viem') with static import
   - Removes per-call overhead and improves type safety
@vieiraricardo vieiraricardo requested a review from Copilot April 8, 2026 19:35
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 87 out of 111 changed files in this pull request and generated 9 comments.

Files not reviewed (2)
  • examples/ai/anthropic-chat/package-lock.json: Language not supported
  • examples/ai/basic-openai/package-lock.json: Language not supported

Comment thread src/payouts/reconcile.ts
Comment thread src/core/client.ts
Comment thread src/cli/commands/configure.ts
Comment thread src/core/agent.ts
Comment thread src/core/client.ts
Comment thread package.json Outdated
Comment thread docs/ai-configuration.md
Comment thread src/__tests__/ai.test.ts
Comment thread src/payouts/reconcile.ts
… failure (#81)

* fix: migrate CI/CD workflow from npm to pnpm to fix ENOLOCK security audit failure

- Add pnpm/action-setup@v4 (version 9) to all three jobs
- Switch cache from npm to pnpm in setup-node steps
- Replace npm ci with pnpm install --frozen-lockfile
- Replace npm audit with pnpm audit (reads pnpm-lock.yaml)
- Replace npx depcheck with pnpm dlx depcheck
- Replace npm run with pnpm run throughout
- Replace npm publish with pnpm publish --no-git-checks

Agent-Logs-Url: https://github.com/SuperDappAI/superdapp-js/sessions/23c32495-4336-4b8e-a923-6d0fa9e21667
@vieiraricardo vieiraricardo requested a review from Copilot April 8, 2026 19:52
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 87 out of 112 changed files in this pull request and generated 10 comments.

Files not reviewed (2)
  • examples/ai/anthropic-chat/package-lock.json: Language not supported
  • examples/ai/basic-openai/package-lock.json: Language not supported

Comment thread .github/workflows/ci-cd.yml Outdated
Comment thread src/core/client.ts
Comment thread src/ai-service/index.ts
Comment thread src/ai-service/client.ts
Comment thread package.json
Comment thread package.json Outdated
Comment thread package.json
Comment thread package.json Outdated
Comment thread src/payouts/execute.ts
Comment thread src/payouts/exporters.ts
vieiraricardo and others added 6 commits April 8, 2026 17:00
- Remove unused @openai/agents-extensions dependency (not referenced in code)
- Add missing @jest/globals devDependency (used in wallet/bridge.test.ts and payouts/web3-client.test.ts)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@vieiraricardo vieiraricardo requested a review from Copilot April 8, 2026 20:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 87 out of 112 changed files in this pull request and generated 14 comments.

Files not reviewed (2)
  • examples/ai/anthropic-chat/package-lock.json: Language not supported
  • examples/ai/basic-openai/package-lock.json: Language not supported

Comment thread src/ai-service/config.ts
Comment thread src/ai-service/types.ts
Comment thread src/payouts/execute.ts
Comment thread src/payouts/execute.ts
Comment thread src/payouts/execute.ts
Comment thread src/payouts/chain-config.ts
Comment thread src/payouts/chain-config.ts
Comment thread src/__tests__/ai-service/cli-env.test.ts
Comment thread src/__tests__/ai-service/cli-env.test.ts
Comment thread docs/ai-configuration.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI Provider config & loader (env/BotConfig → model)

4 participants