Skip to content

Commit 9367d1d

Browse files
committed
chore: merge main into refactor/migrate-requests-to-httpx
Resolved conflicts in: - pyproject.toml: Added new ty dependency from main - tests/test_meta_tools.py: Updated test URLs to use hibob while keeping httpx/respx approach - uv.lock: Regenerated to incorporate changes from both branches All tests passing after merge.
2 parents 0150b6f + 2278a9f commit 9367d1d

25 files changed

+237
-200
lines changed

.claude/rules/development-workflow.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ This rule provides code style guidelines and project conventions for the StackOn
1818

1919
- Full type annotations required for all public APIs
2020
- Use Python 3.11+ typing features
21-
- Run `just mypy` to verify type correctness
22-
- Strict mypy configuration is enforced
21+
- Run `just ty` to verify type correctness
22+
- Strict ty configuration is enforced
2323

2424
## Pre-commit Hooks
2525

2626
Pre-commit hooks are configured for:
2727

2828
- ruff linting
29-
- mypy type checking
29+
- ty type checking
3030

3131
Run `just install` to set up hooks.
3232

@@ -36,7 +36,7 @@ Run `just install` to set up hooks.
3636
just install # Install dependencies and pre-commit hooks
3737
just lint # Run ruff linting
3838
just lint-fix # Auto-fix linting issues
39-
just mypy # Run type checking
39+
just ty # Run type checking
4040
just test # Run all tests
4141
just test-tools # Run tool-specific tests
4242
just test-examples # Run example tests

.github/workflows/ci.yaml

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,24 @@ concurrency:
1212

1313
permissions:
1414
contents: read
15+
pages: write
16+
id-token: write
1517

1618
jobs:
19+
gitleaks:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Setup Nix
28+
uses: ./.github/actions/setup-nix
29+
30+
- name: Run Gitleaks
31+
run: nix develop --command just gitleaks
32+
1733
typos:
1834
runs-on: ubuntu-latest
1935
steps:
@@ -54,8 +70,51 @@ jobs:
5470
- name: Run Lint
5571
run: nix develop --command just lint
5672

57-
- name: Run Mypy
58-
run: nix develop --command just mypy
73+
- name: Run Ty
74+
run: nix develop --command just ty
5975

6076
- name: Run Tests
6177
run: nix develop --command just test
78+
79+
coverage:
80+
runs-on: ubuntu-latest
81+
if: github.ref == 'refs/heads/main'
82+
env:
83+
STACKONE_API_KEY: ${{ secrets.STACKONE_API_KEY }}
84+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
85+
steps:
86+
- name: Checkout repository
87+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
88+
89+
- name: Setup Nix
90+
uses: ./.github/actions/setup-nix
91+
92+
- name: Install dependencies
93+
run: nix develop --command just install --all-extras
94+
95+
- name: Run Tests with Coverage
96+
run: nix develop --command just coverage
97+
98+
- name: Create Coverage Badge
99+
uses: jaywcjlove/coverage-badges-cli@bd6ccbf422c0ed54c01f283019fd2bc648f58541 # v2.2.0
100+
with:
101+
source: coverage/coverage.json
102+
output: coverage/badges.svg
103+
jsonPath: totals.percent_covered
104+
105+
- name: Upload coverage artifact
106+
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v3.0.2
107+
with:
108+
path: coverage/
109+
110+
deploy-coverage:
111+
needs: coverage
112+
runs-on: ubuntu-latest
113+
if: github.ref == 'refs/heads/main'
114+
environment:
115+
name: github-pages
116+
url: ${{ steps.deployment.outputs.page_url }}
117+
steps:
118+
- name: Deploy to GitHub Pages
119+
id: deployment
120+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
.pytest_cache
66
.python-version
77
__pycache__
8+
.coverage
9+
coverage/
810

911
.DS_Store
1012

.gitleaks.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Gitleaks configuration
2+
# https://github.com/gitleaks/gitleaks
3+
4+
[extend]
5+
useDefault = true
6+
7+
[allowlist]
8+
description = "Global allowlist"
9+
paths = [
10+
'''\.lock$''',
11+
'''\.snap$''',
12+
'''uv\.lock$''',
13+
]

CLAUDE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ just install # Install dependencies and pre-commit hooks
3333
# Code quality
3434
just lint # Run ruff linting
3535
just lint-fix # Auto-fix linting issues
36-
just mypy # Run type checking
36+
just ty # Run type checking
3737

3838
# Testing
3939
just test # Run all tests
@@ -88,7 +88,7 @@ toolset = StackOneToolSet(
8888
### Type Safety
8989

9090
- Full type annotations required (Python 3.11+)
91-
- Strict mypy configuration
91+
- Strict ty configuration
9292
- Use generics for better IDE support
9393

9494
### Testing
@@ -100,7 +100,7 @@ toolset = StackOneToolSet(
100100
## Important Considerations
101101

102102
1. **Dependencies**: See `package-installation` rule for uv dependency management
103-
2. **Pre-commit**: Hooks configured for ruff and mypy - run on all commits
103+
2. **Pre-commit**: Hooks configured for ruff and ty - run on all commits
104104
3. **Python Version**: Requires Python >=3.11
105105
4. **Error Handling**: Custom exceptions (`StackOneError`, `StackOneAPIError`)
106106
5. **File Uploads**: Binary parameters auto-detected from OpenAPI specs

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
[![PyPI version](https://badge.fury.io/py/stackone-ai.svg)](https://badge.fury.io/py/stackone-ai)
44
[![GitHub release (latest by date)](https://img.shields.io/github/v/release/StackOneHQ/stackone-ai-python)](https://github.com/StackOneHQ/stackone-ai-python/releases)
5+
[![Coverage](https://stackonehq.github.io/stackone-ai-python/badges.svg)](https://stackonehq.github.io/stackone-ai-python/html/)
56

67
StackOne AI provides a unified interface for accessing various SaaS tools through AI-friendly APIs.
78

@@ -47,7 +48,7 @@ The Nix development environment includes:
4748

4849
- Python with uv package manager
4950
- Automatic dependency installation
50-
- Git hooks (treefmt + mypy) auto-configured
51+
- Git hooks (treefmt + ty) auto-configured
5152
- Consistent environment across all platforms
5253

5354
### Using pip/uv

examples/crewai_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
def crewai_integration():
2020
toolset = StackOneToolSet()
21-
tools = toolset.fetch_tools(actions=["hris_*"], account_ids=[account_id])
21+
tools = toolset.fetch_tools(actions=["bamboohr_*"], account_ids=[account_id])
2222

2323
# CrewAI uses LangChain tools natively
2424
langchain_tools = tools.to_langchain()

examples/file_uploads.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
22
Example demonstrating file upload functionality using StackOne.
3-
Shows how to upload an employee document using an HRIS integration.
3+
Shows how to upload an employee document using a BambooHR integration.
44
55
This example is runnable with the following command:
66
```bash
@@ -24,7 +24,7 @@
2424
"""
2525
# Resume content
2626
27-
This is a sample resume content that will be uploaded using the `hris_upload_employee_document` tool.
27+
This is a sample resume content that will be uploaded using the `bamboohr_upload_employee_document` tool.
2828
"""
2929

3030
resume_content = """
@@ -46,7 +46,7 @@
4646
"""
4747
# Upload employee document
4848
49-
This function uploads a resume using the `hris_upload_employee_document` tool.
49+
This function uploads a resume using the `bamboohr_upload_employee_document` tool.
5050
5151
"""
5252

@@ -57,9 +57,9 @@ def upload_employee_document() -> None:
5757
resume_file.write_text(resume_content)
5858

5959
toolset = StackOneToolSet()
60-
tools = toolset.fetch_tools(actions=["hris_*"], account_ids=[account_id])
60+
tools = toolset.fetch_tools(actions=["bamboohr_*"], account_ids=[account_id])
6161

62-
upload_tool = tools.get_tool("hris_upload_employee_document")
62+
upload_tool = tools.get_tool("bamboohr_upload_employee_document")
6363
assert upload_tool is not None
6464

6565
with open(resume_file, "rb") as f:

examples/index.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
StackOne AI SDK provides an AI-friendly interface for accessing various SaaS tools through the StackOne Unified API.
2+
StackOne AI SDK provides an AI-friendly interface for accessing various SaaS tools through the StackOne API.
33
44
This SDK is available on [PyPI](https://pypi.org/project/stackone-ai/) for python projects. There is a node version in the works.
55
@@ -72,11 +72,11 @@
7272
def quickstart():
7373
toolset = StackOneToolSet()
7474

75-
# Get all HRIS-related tools using MCP-backed fetch_tools()
76-
tools = toolset.fetch_tools(actions=["hris_*"], account_ids=[account_id])
75+
# Get all BambooHR-related tools using MCP-backed fetch_tools()
76+
tools = toolset.fetch_tools(actions=["bamboohr_*"], account_ids=[account_id])
7777

7878
# Use a specific tool
79-
employee_tool = tools.get_tool("hris_list_employees")
79+
employee_tool = tools.get_tool("bamboohr_list_employees")
8080
assert employee_tool is not None
8181

8282
employees = employee_tool.execute()

examples/langchain_integration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
def langchain_integration() -> None:
2121
toolset = StackOneToolSet()
22-
tools = toolset.fetch_tools(actions=["hris_*"], account_ids=[account_id])
22+
tools = toolset.fetch_tools(actions=["bamboohr_*"], account_ids=[account_id])
2323

2424
# Convert to LangChain format and verify
2525
langchain_tools = tools.to_langchain()

0 commit comments

Comments
 (0)