Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
## Earn Team
/packages/earn-controller @MetaMask/earn

## Social AI Team
/packages/ai-controllers @MetaMask/social-ai
Copy link
Member

Choose a reason for hiding this comment

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

This team does not seem to exist yet, so it can't be added to the repo and thus won't be valid for CODEOWNERS

Copy link
Contributor Author

Choose a reason for hiding this comment

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


## Ramp Team
/packages/ramps-controller @MetaMask/ramp

Expand Down Expand Up @@ -199,3 +202,5 @@
/packages/core-backend/CHANGELOG.md @MetaMask/core-platform @MetaMask/metamask-assets
/packages/claims-controller/package.json @MetaMask/web3auth @MetaMask/core-platform
/packages/claims-controller/CHANGELOG.md @MetaMask/web3auth @MetaMask/core-platform
/packages/ai-controllers/package.json @MetaMask/social-ai @MetaMask/core-platform
/packages/ai-controllers/CHANGELOG.md @MetaMask/social-ai @MetaMask/core-platform
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Each package in this repository has its own README where you can find installati
- [`@metamask/account-tree-controller`](packages/account-tree-controller)
- [`@metamask/accounts-controller`](packages/accounts-controller)
- [`@metamask/address-book-controller`](packages/address-book-controller)
- [`@metamask/ai-controllers`](packages/ai-controllers)
- [`@metamask/analytics-controller`](packages/analytics-controller)
- [`@metamask/announcement-controller`](packages/announcement-controller)
- [`@metamask/app-metadata-controller`](packages/app-metadata-controller)
Expand Down Expand Up @@ -100,6 +101,7 @@ linkStyle default opacity:0.5
account_tree_controller(["@metamask/account-tree-controller"]);
accounts_controller(["@metamask/accounts-controller"]);
address_book_controller(["@metamask/address-book-controller"]);
ai_controllers(["@metamask/ai-controllers"]);
analytics_controller(["@metamask/analytics-controller"]);
announcement_controller(["@metamask/announcement-controller"]);
app_metadata_controller(["@metamask/app-metadata-controller"]);
Expand Down
14 changes: 14 additions & 0 deletions packages/ai-controllers/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- Initial release ([#7693](https://github.com/MetaMask/core/pull/7693))

[Unreleased]: https://github.com/MetaMask/core/
20 changes: 20 additions & 0 deletions packages/ai-controllers/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
MIT License

Copyright (c) 2026 MetaMask

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
15 changes: 15 additions & 0 deletions packages/ai-controllers/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# `@metamask/ai-controllers`

A collection of AI-related controllers.

## Installation

`yarn add @metamask/ai-controllers`

or

`npm install @metamask/ai-controllers`

## Contributing

This package is part of a monorepo. Instructions for contributing can be found in the [monorepo README](https://github.com/MetaMask/core#readme).
26 changes: 26 additions & 0 deletions packages/ai-controllers/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/*
* For a detailed explanation regarding each configuration property and type check, visit:
* https://jestjs.io/docs/configuration
*/

const merge = require('deepmerge');
const path = require('path');

const baseConfig = require('../../jest.config.packages');

const displayName = path.basename(__dirname);

module.exports = merge(baseConfig, {
// The display name when running multiple projects
displayName,

// An object that configures minimum threshold enforcement for coverage results
coverageThreshold: {
global: {
branches: 100,
functions: 100,
lines: 100,
statements: 100,
},
},
});
68 changes: 68 additions & 0 deletions packages/ai-controllers/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"name": "@metamask/ai-controllers",
"version": "0.0.0",
"description": "A collection of AI-related controllers",
"keywords": [
"MetaMask",
"Ethereum"
],
"homepage": "https://github.com/MetaMask/core/tree/main/packages/ai-controllers#readme",
"bugs": {
"url": "https://github.com/MetaMask/core/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/MetaMask/core.git"
},
"license": "MIT",
"sideEffects": false,
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"./package.json": "./package.json"
},
"main": "./dist/index.cjs",
"types": "./dist/index.d.cts",
"files": [
"dist/"
],
"scripts": {
"build": "ts-bridge --project tsconfig.build.json --verbose --clean --no-references",
"build:all": "ts-bridge --project tsconfig.build.json --verbose --clean",
"build:docs": "typedoc",
"changelog:update": "../../scripts/update-changelog.sh @metamask/ai-controllers",
"changelog:validate": "../../scripts/validate-changelog.sh @metamask/ai-controllers",
"publish:preview": "yarn npm publish --tag preview",
"since-latest-release": "../../scripts/since-latest-release.sh",
"test": "NODE_OPTIONS=--experimental-vm-modules jest --reporters=jest-silent-reporter",
"test:clean": "NODE_OPTIONS=--experimental-vm-modules jest --clearCache",
"test:verbose": "NODE_OPTIONS=--experimental-vm-modules jest --verbose",
"test:watch": "NODE_OPTIONS=--experimental-vm-modules jest --watch"
},
"devDependencies": {
"@metamask/auto-changelog": "^3.4.4",
"@ts-bridge/cli": "^0.6.4",
"@types/jest": "^27.4.1",
"deepmerge": "^4.2.2",
"jest": "^27.5.1",
"ts-jest": "^27.1.4",
"typedoc": "^0.24.8",
"typedoc-plugin-missing-exports": "^2.0.0",
"typescript": "~5.3.3"
},
"engines": {
"node": "^18.18 || >=20"
},
"publishConfig": {
"access": "public",
"registry": "https://registry.npmjs.org/"
}
}
9 changes: 9 additions & 0 deletions packages/ai-controllers/src/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import greeter from '.';

describe('Test', () => {
it('greets', () => {
const name = 'Huey';
const result = greeter(name);
expect(result).toBe('Hello, Huey!');
});
});
9 changes: 9 additions & 0 deletions packages/ai-controllers/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* Example function that returns a greeting for the given name.
*
* @param name - The name to greet.
* @returns The greeting.
*/
export default function greeter(name: string): string {
return `Hello, ${name}!`;
}
10 changes: 10 additions & 0 deletions packages/ai-controllers/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../../tsconfig.packages.build.json",
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist",
"rootDir": "./src"
},
"references": [],
"include": ["../../types", "./src"]
}
8 changes: 8 additions & 0 deletions packages/ai-controllers/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"extends": "../../tsconfig.packages.json",
"compilerOptions": {
"baseUrl": "./"
},
"references": [],
"include": ["../../types", "./src"]
}
7 changes: 7 additions & 0 deletions packages/ai-controllers/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"entryPoints": ["./src/index.ts"],
"excludePrivate": true,
"hideGenerator": true,
"out": "docs",
"tsconfig": "./tsconfig.build.json"
}
1 change: 1 addition & 0 deletions teams.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"metamask/accounts-controller": "team-accounts-framework",
"metamask/ai-controllers": "team-social-ai",
"metamask/multichain-transactions-controller": "team-confirmations",
"metamask/multichain-account-service": "team-accounts-framework",
"metamask/account-tree-controller": "team-accounts-framework",
Expand Down
3 changes: 3 additions & 0 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
{
"path": "./packages/address-book-controller/tsconfig.build.json"
},
{
"path": "./packages/ai-controllers/tsconfig.build.json"
},
{
"path": "./packages/analytics-controller/tsconfig.build.json"
},
Expand Down
3 changes: 3 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
{
"path": "./packages/address-book-controller"
},
{
"path": "./packages/ai-controllers"
},
{
"path": "./packages/analytics-controller"
},
Expand Down
16 changes: 16 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2538,6 +2538,22 @@ __metadata:
languageName: unknown
linkType: soft

"@metamask/ai-controllers@workspace:packages/ai-controllers":
version: 0.0.0-use.local
resolution: "@metamask/ai-controllers@workspace:packages/ai-controllers"
dependencies:
"@metamask/auto-changelog": "npm:^3.4.4"
"@ts-bridge/cli": "npm:^0.6.4"
"@types/jest": "npm:^27.4.1"
deepmerge: "npm:^4.2.2"
jest: "npm:^27.5.1"
ts-jest: "npm:^27.1.4"
typedoc: "npm:^0.24.8"
typedoc-plugin-missing-exports: "npm:^2.0.0"
typescript: "npm:~5.3.3"
languageName: unknown
linkType: soft

"@metamask/analytics-controller@workspace:packages/analytics-controller":
version: 0.0.0-use.local
resolution: "@metamask/analytics-controller@workspace:packages/analytics-controller"
Expand Down
Loading