npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@framers/agentos-ext-channel-threads

v0.1.5

Published

Threads channel adapter for AgentOS — post text, images, videos, carousels, replies, quotes, likes, and analytics via Meta Threads API.

Readme

Threads channel

This pack gives an agent tools to publish Threads posts, replies and quotes, change likes, browse recent posts and read engagement metrics. Its channel adapter calls Meta's Threads Publishing API through axios.

Installation

npm install @framers/agentos-ext-channel-threads

Peer dependency: @framers/agentos at >=0.10.40.

Usage

import { AgentOS } from '@framers/agentos';

const agentos = await AgentOS.create({
  extensionManifest: {
    packs: [
      {
        package: '@framers/agentos-ext-channel-threads',
        options: {
          accessToken: process.env.THREADS_ACCESS_TOKEN,
          userId: process.env.THREADS_USER_ID,
        },
      },
    ],
  },
});

Configuration

Credentials resolve from direct options, then the selected secrets map, then the environment. The secrets map is options.secrets when supplied, otherwise context.secrets; the maps are not merged.

| Option | Secret id | Environment variable | Required | Default | | --- | --- | --- | --- | --- | | accessToken | threads.accessToken | THREADS_ACCESS_TOKEN, META_ACCESS_TOKEN | yes | Empty string; activation attempts token-store fallback | | userId | threads.userId | THREADS_USER_ID | no | Resolved from /me during initialization | | secrets in options or context | threads.accessToken, threads.userId | None | no | Empty map |

Tools

| Tool | What it does | | --- | --- | | threadsPost | Creates a post with text and optional image, video or carousel items. | | threadsReply | Replies to a post with text and optional media. | | threadsLike | Likes or unlikes a post. | | threadsSearch | Browses recent user posts and optionally filters their text. | | threadsAnalytics | Gets views, likes, replies, reposts and quotes for a post. | | threadsQuote | Quotes a post with a comment. |

threadsPost

| Parameter | Type | Required | Description | | --- | --- | --- | --- | | text | string | yes | Post text (max 500 characters) | | imageUrl | string | no | URL of image to attach | | videoUrl | string | no | URL of video to attach | | carouselItems | object[] | no | Carousel items (array of image/video objects) |

Each object in carouselItems has this schema:

| Parameter | Type | Required | Description | | --- | --- | --- | --- | | type | string: IMAGE, VIDEO | yes | Media type | | url | string | yes | Media URL |

threadsReply

| Parameter | Type | Required | Description | | --- | --- | --- | --- | | postId | string | yes | ID of the Threads post to reply to | | text | string | yes | Reply text | | mediaUrl | string | no | Optional image or video URL to attach |

threadsLike

| Parameter | Type | Required | Description | | --- | --- | --- | --- | | postId | string | yes | ID of the Threads post | | unlike | boolean | no | Set to true to unlike; defaults to false |

threadsSearch

| Parameter | Type | Required | Description | | --- | --- | --- | --- | | query | string | no | Optional filter keyword (client-side filtering on returned posts) | | limit | number | no | Max posts to return (default 25, max 100) |

threadsAnalytics

| Parameter | Type | Required | Description | | --- | --- | --- | --- | | postId | string | yes | ID of the Threads post to analyze |

threadsQuote

| Parameter | Type | Required | Description | | --- | --- | --- | --- | | postId | string | yes | ID of the Threads post to quote | | text | string | yes | Your quote comment |

Channel adapter

The adapter registers platform threads. Initialization creates an authenticated HTTP client and resolves the user id. Sending ignores conversationId: it uses replyToMessageId for replies, then selects carousel_item blocks, video, image or text content for a new post. Each carousel block uses mediaType and url. Reactions like the specified message regardless of the reaction value. The adapter stores handlers but does not emit inbound events. Typing indicators do nothing.

Notes

Posting, replying and quoting publish content; liking and unliking change account interactions. The exported ThreadsService.deletePost deletes a post, but the factory does not register a deletion tool.

When the resolved token is empty, activation attempts to load the threads token through FileTokenStore from @framers/agentos/auth. Activation throws if no token is available. An omitted userId triggers a profile request.

Media publishing creates containers and waits for FINISHED before publishing. Image, carousel child and media reply polling allows 20 attempts with a 1000 ms interval. Standalone video polling allows 30 attempts with a 2000 ms interval. An ERROR status or exhausted attempts makes publishing fail.

threadsSearch retrieves the configured user's recent posts and filters the returned text locally, ignoring case. It does not perform a remote keyword search. The post schema describes a 500-character text limit; the tool does not enforce that limit locally.

License

Apache-2.0