← 返回首页
Feat(templates): add regulatory-filling-monitor TypeScript template by carlosleao-plank · Pull Request #100 · kernel/cli · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

Feat(templates): add regulatory-filling-monitor TypeScript template#100

Open
carlosleao-plank wants to merge 7 commits into
kernel:mainfrom
kevintatagiba-plank:feat/template-regulatory-filling-monitor
Open

Feat(templates): add regulatory-filling-monitor TypeScript template#100
carlosleao-plank wants to merge 7 commits into
kernel:mainfrom
kevintatagiba-plank:feat/template-regulatory-filling-monitor

Conversation

carlosleao-plank commented Jan 29, 2026
edited by cursor Bot
Loading

Copy link
Copy Markdown

Summary

This PR adds a new Kernel TypeScript template that monitors SEC EDGAR regulatory filings using Anthropic Computer Use with Kernel’s Computer Controls API.

Demo (Loom):
https://www.loom.com/share/c4923cc443504c128a561ff35b040f32

Data Source:
SEC EDGAR Search — https://www.sec.gov/edgar/search/

The template demonstrates end-to-end browser automation via Claude’s computer-use capability to search, filter, and extract structured SEC filing data. It also supports optional video replay recording for debugging and auditing browser sessions.

Features

  • SEC EDGAR Search Automation
    Navigates to SEC EDGAR, applies company/state/date filters, configures visible columns, and extracts structured filing data.

  • Anthropic Computer Use Integration
    Uses claude-sonnet-4-5-20250929 with a thinking budget for visual browser navigation.

  • Kernel Browser Session Management
    KernelBrowserSession class manages browser lifecycle with stealth mode and optional replay recording.

  • Robust Output Parsing
    Multiple fallback strategies (JSON array, line-by-line parsing, regex) to reliably extract filings from LLM output.

  • Computer Tool Implementations
    Full implementation of Anthropic computer_20241022 and computer_20250124 tool specs, mapped to Kernel’s xdotool-based API.

Usage

# Deploy kernel deploy index.ts --env-file .env # Search for Apple filings (defaults to today) kernel invoke ts-regulatory-filling-monitor sec-edgar-task --payload '{"company": "Apple"}' # With state filter and specific date kernel invoke ts-regulatory-filling-monitor sec-edgar-task --payload '{"company": "AAPL", "state": "CA", "date": "2025-10-02"}' # With replay recording kernel invoke ts-regulatory-filling-monitor sec-edgar-task --payload '{"company": "Tesla", "record_replay": true}'

Output

The sec-edgar-task action returns a JSON object with the following structure:

{ "filings": [ { "formAndFile": "10-K", "filedDate": "2025-01-15", "filingEntityPerson": "Apple Inc.", "cik": "0000320193", "located": "CA", "fileNumber": "001-36743", "filmNumber": "25123456" } ], "replay_url": "https://..." }
  • If no filings are found, filings will be an empty array []
  • Missing values are returned as empty strings ""
  • replay_url is only present when record_replay: true is provided and the user has a paid Kernel plan

Note

Low Risk
Adds a new standalone template under pkg/templates/typescript/ with no changes to existing runtime paths; risk is limited to template correctness and dependency footprint.

Overview
Adds a new TypeScript template, regulatory-filling-monitor, that uses Kernel browser sessions plus Anthropic Computer Use to navigate the SEC EDGAR search UI, apply company/state/date filters, and return structured filing results.

Includes a reusable browser session wrapper with optional replay recording, a samplingLoop that wires Anthropic beta tool calls to Kernel computer controls (with prompt caching/thinking support), and robust parsing of model output via explicit markers with fallbacks. Also adds template scaffolding (README.md, .env.example, _gitignore, tsconfig.json, package.json/lock) and the computer tool/action type + validation utilities.

Written by Cursor Bugbot for commit a8114dd. This will update automatically on new commits. Configure here.

cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

Cursor Bugbot has reviewed your changes and found 3 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

* Stop recording, and delete the browser session.
*/
async stop(): Promise<SessionInfo> {
const info = this.info;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

stop() method throws when session not started

Medium Severity

The stop() method calls this.info at line 188, which accesses the sessionId getter that throws if _sessionId is null. This happens before the if (this._sessionId) check at line 190. As a result, stop() throws an error when called before start() or when called twice (since stop() sets _sessionId = null at the end). The null check is positioned too late to prevent the error. Cleanup methods are typically expected to be idempotent.

Additional Locations (1)

 

role: 'user',
content: toolResultContent,
});
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

Loop continues without tool results causing API error

Medium Severity

When response.stop_reason is 'tool_use' but the tool_use blocks have invalid structure (missing action property or non-string action), the code silently skips processing them. The assistant message is pushed (line 144-147), but no tool_result message follows. The exit condition at line 185 evaluates to false because stop_reason !== 'tool_use' is false, so the loop continues. The next API call receives an invalid message sequence (tool_use without tool_result), causing a confusing API error.

Additional Locations (1)

 

}

const scrollDirection = scrollDirectionParam || kwargs.scroll_direction;
const scrollAmountValue = scrollAmount || scroll_amount;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

Falsy scroll amount zero ignored due to || operator

Low Severity

Using || instead of ?? for scrollAmount || scroll_amount treats scrollAmount: 0 as falsy, causing it to fall back to scroll_amount. If scroll_amount is undefined, scrollAmountValue becomes undefined and validation fails with a confusing error. If scroll_amount is a non-zero value, that value is used instead of the intended zero. The same issue exists on line 291 for scrollDirection.

 

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

1 participant

Footer

© 2026 GitHub, Inc.