Skip to content

Commit 64f3c82

Browse files
committed
Merge origin/main into refactor/test-reorganisation
2 parents ae06ad8 + b6af300 commit 64f3c82

17 files changed

Lines changed: 394 additions & 351 deletions

‎.env_example‎

Lines changed: 0 additions & 2 deletions
This file was deleted.

‎.github/workflows/nix-flake.yaml‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,14 @@ on:
55
paths:
66
- 'flake.nix'
77
- 'flake.lock'
8-
- '.github/workflows/nix-flake.yml'
8+
- '.github/workflows/nix-flake.yaml'
99
- '.github/actions/setup-nix/**'
1010
pull_request:
11+
paths:
12+
- 'flake.nix'
13+
- 'flake.lock'
14+
- '.github/workflows/nix-flake.yaml'
15+
- '.github/actions/setup-nix/**'
1116

1217
concurrency:
1318
group: ${{ github.workflow }}-${{ github.ref }}

‎README.md‎

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

33
> A unified interface for performing actions on SaaS tools through AI-friendly APIs.
44
5-
[![DeepWiki](https://img.shields.io/badge/DeepWiki-StackOneHQ%2Fstackone--ai--node-blue.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAyCAYAAAAnWDnqAAAAAXNSR0IArs4c6QAAA05JREFUaEPtmUtyEzEQhtWTQyQLHNak2AB7ZnyXZMEjXMGeK/AIi+QuHrMnbChYY7MIh8g01fJoopFb0uhhEqqcbWTp06/uv1saEDv4O3n3dV60RfP947Mm9/SQc0ICFQgzfc4CYZoTPAswgSJCCUJUnAAoRHOAUOcATwbmVLWdGoH//PB8mnKqScAhsD0kYP3j/Yt5LPQe2KvcXmGvRHcDnpxfL2zOYJ1mFwrryWTz0advv1Ut4CJgf5uhDuDj5eUcAUoahrdY/56ebRWeraTjMt/00Sh3UDtjgHtQNHwcRGOC98BJEAEymycmYcWwOprTgcB6VZ5JK5TAJ+fXGLBm3FDAmn6oPPjR4rKCAoJCal2eAiQp2x0vxTPB3ALO2CRkwmDy5WohzBDwSEFKRwPbknEggCPB/imwrycgxX2NzoMCHhPkDwqYMr9tRcP5qNrMZHkVnOjRMWwLCcr8ohBVb1OMjxLwGCvjTikrsBOiA6fNyCrm8V1rP93iVPpwaE+gO0SsWmPiXB+jikdf6SizrT5qKasx5j8ABbHpFTx+vFXp9EnYQmLx02h1QTTrl6eDqxLnGjporxl3NL3agEvXdT0WmEost648sQOYAeJS9Q7bfUVoMGnjo4AZdUMQku50McDcMWcBPvr0SzbTAFDfvJqwLzgxwATnCgnp4wDl6Aa+Ax283gghmj+vj7feE2KBBRMW3FzOpLOADl0Isb5587h/U4gGvkt5v60Z1VLG8BhYjbzRwyQZemwAd6cCR5/XFWLYZRIMpX39AR0tjaGGiGzLVyhse5C9RKC6ai42ppWPKiBagOvaYk8lO7DajerabOZP46Lby5wKjw1HCRx7p9sVMOWGzb/vA1hwiWc6jm3MvQDTogQkiqIhJV0nBQBTU+3okKCFDy9WwferkHjtxib7t3xIUQtHxnIwtx4mpg26/HfwVNVDb4oI9RHmx5WGelRVlrtiw43zboCLaxv46AZeB3IlTkwouebTr1y2NjSpHz68WNFjHvupy3q8TFn3Hos2IAk4Ju5dCo8B3wP7VPr/FGaKiG+T+v+TQqIrOqMTL1VdWV1DdmcbO8KXBz6esmYWYKPwDL5b5FA1a0hwapHiom0r/cKaoqr+27/XcrS5UwSMbQAAAABJRU5ErkJggg==)](https://deepwiki.com/StackOneHQ/stackone-ai-node)
5+
[![DeepWiki](https://img.shields.io/badge/DeepWiki-StackOneHQ%2Fstackone--ai--node-blue.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAyCAYAAAAnWDnqAAAAAXNSR0IArs4c6QAAA05JREFUaEPtmUtyEzEQhtWTQyQLHNak2AB7ZnyXZMEjXMGeK/AIi+QuHrMnbChYY7MIh8g01fJoopFb0uhhEqqcbWTp06/uv1saEDv4O3n3dV60RfP947Mm9/SQc0ICFQgzfc4CYZoTPAswgSJCCUJUnAAoRHOAUOcATwbmVLWdGoH//PB8mnKqScAhsD0kYP3j/Yt5LPQe2KvcXmGvRHcDnpxfL2zOYJ1mFwrryWTz0advv1Ut4CJgf5uhDuDj5eUcAUoahrdY/56ebRWeraTjMt/00Sh3UDtjgHtQNHwcRGOC98BJEAEymycmYcWwOprTgcB6VZ5JK5TAJ+fXGLBm3FDAmn6oPPjR4rKCAoJCal2eAiQp2x0vxTPB3ALO2CRkwmDy5WohzBDwSEFKRwPbknEggCPB/imwrycgxX2NzoMCHhPkDwqYMr9tRcP5qNrMZHkVnOjRMWwLCcr8ohBVb1OMjxLwGCvjTikrsBOiA6fNyCrm8V1rP93iVPpwaE+gO0SsWmPiXB+jikdf6SizrT5qKasx5j8ABbHpFTx+vFXp9EnYQmLx02h1QTTrl6eDqxLnGjporxl3NL3agEvXdT0WmEost648sQOYAeJS9Q7bfUVoMGnjo4AZdUMQku50McDcMWcBPvr0SzbTAFDfvJqwLzgxwATnCgnp4wDl6Aa+Ax283gghmj+vj7feE2KBBRMW3FzOpLOADl0Isb5587h/U4gGvkt5v60Z1VLG8BhYjbzRwyQZemwAd6cCR5/XFWLYZRIMpX39AR0tjaGGiGzLVyhse5C9RKC6ai42ppWPKiBagOvaYk8lO7DajerabOZP46Lby5wKjw1HCRx7p9sVMOWGzb/vA1hwiWc6jm3MvQDTogQkiqIhJV0nBQBTU+3okKCFDy9WwferkHjtxib7t3xIUQtHxnIwtx4mpg26/HfwVNVDb4oI9RHmx5WGelRVlrtiw43zboCLaxv46AZeB3IlTkwouebTr1y2NjSpHz68WNFjHvupy3q8TFn3Hos2IAk4Ju5dCo8B3wP7VPr/FGaKiG+T+v+TQqIrOqMTL1VdWV1DdmcbO8KXBz6esmYWYKPwDL5b5FA1a0hwapHiom0r/cKaoqr+27/XcrS5UwSMbQAAAABJRU5ErkJggg==)](https://deepwiki.com/StackOneHQ/stackone-ai-node) [![Coverage](https://stackonehq.github.io/stackone-ai-node/badges.svg)](https://stackonehq.github.io/stackone-ai-node)
66

77
<!-- DeepWiki badge generated by https://deepwiki.ryoppippi.com/ -->
88

‎examples/README.md‎

Lines changed: 7 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -38,32 +38,15 @@ OPENAI_API_KEY=your_api_key_here
3838

3939
### 3. Configure Account IDs
4040

41-
Update the account IDs in [`constants.ts`](./constants.ts) with your actual integration account IDs:
41+
Each example includes a placeholder account ID that you need to replace with your actual StackOne account ID:
4242

4343
```typescript
44-
export const ACCOUNT_IDS = {
45-
// Human Resources Information System
46-
HRIS: "your_hris_account_id",
47-
48-
// Applicant Tracking System
49-
ATS: "your_ats_account_id",
50-
51-
// Customer Relationship Management
52-
CRM: "your_crm_account_id",
53-
54-
// Document Management System
55-
DOCUMENTS: "your_documents_account_id",
56-
57-
// Test account IDs (used in examples that don't make real API calls)
58-
TEST: {
59-
VALID: "test_account_id",
60-
OVERRIDE: "test_account_id_override",
61-
DIRECT: "test_account_id_direct",
62-
INVALID: "invalid_test_account_id",
63-
},
64-
};
44+
// Replace with your actual account ID from StackOne dashboard
45+
const accountId = 'your-hris-account-id';
6546
```
6647

48+
You can find your account IDs in the [StackOne dashboard](https://app.stackone.com).
49+
6750
## Running Examples
6851

6952
### Run Individual Examples
@@ -287,7 +270,7 @@ cd examples && pnpm test examples.spec.ts
287270
### Common Issues
288271

289272
1. **Authentication Errors**: Ensure `STACKONE_API_KEY` is set correctly
290-
2. **Account ID Errors**: Update account IDs in `constants.ts` with your actual values
273+
2. **Account ID Errors**: Update account ID placeholders in the example files with your actual values
291274
3. **Network Errors**: Check if you're behind a proxy or firewall
292275
4. **TypeScript Errors**: Ensure you're using compatible Node.js and TypeScript versions
293276

@@ -306,7 +289,7 @@ When adding new examples:
306289
3. Include proper error handling
307290
4. Add TypeScript types
308291
5. Test with the examples test suite
309-
6. Update `constants.ts` if new account IDs are needed
292+
6. Use inline placeholder account IDs with clear comments (e.g., `const accountId = 'your-hris-account-id';`)
310293

311294
## License
312295

‎examples/ai-sdk-integration.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,20 @@ import process from 'node:process';
77
import { openai } from '@ai-sdk/openai';
88
import { StackOneToolSet } from '@stackone/ai';
99
import { generateText, stepCountIs } from 'ai';
10-
import { ACCOUNT_IDS } from './constants';
1110

1211
const apiKey = process.env.STACKONE_API_KEY;
1312
if (!apiKey) {
1413
console.error('STACKONE_API_KEY environment variable is required');
1514
process.exit(1);
1615
}
1716

17+
// Replace with your actual account ID from StackOne dashboard
18+
const accountId = 'your-hris-account-id';
19+
1820
const aiSdkIntegration = async (): Promise<void> => {
1921
// Initialise StackOne
2022
const toolset = new StackOneToolSet({
21-
accountId: ACCOUNT_IDS.HRIS,
23+
accountId,
2224
baseUrl: process.env.STACKONE_BASE_URL ?? 'https://api.stackone.com',
2325
});
2426

‎examples/constants.ts‎

Lines changed: 0 additions & 26 deletions
This file was deleted.

‎examples/human-in-the-loop.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@ import process from 'node:process';
1111
import { openai } from '@ai-sdk/openai';
1212
import { type JsonDict, StackOneToolSet } from '@stackone/ai';
1313
import { generateText, stepCountIs } from 'ai';
14-
import { ACCOUNT_IDS } from './constants';
1514

1615
const apiKey = process.env.STACKONE_API_KEY;
1716
if (!apiKey) {
1817
console.error('STACKONE_API_KEY environment variable is required');
1918
process.exit(1);
2019
}
2120

21+
// Replace with your actual account ID from StackOne dashboard
22+
const accountId = 'your-hris-account-id';
23+
2224
interface ToolCall {
2325
toolName: string;
2426
args: Record<string, unknown>;
@@ -27,7 +29,7 @@ interface ToolCall {
2729
const humanInTheLoopExample = async (): Promise<void> => {
2830
// Create a toolset
2931
const toolset = new StackOneToolSet({
30-
accountId: ACCOUNT_IDS.HRIS,
32+
accountId,
3133
baseUrl: process.env.STACKONE_BASE_URL ?? 'https://api.stackone.com',
3234
});
3335

‎examples/index.ts‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,13 @@
2727
* # Account IDs
2828
*
2929
* StackOne uses account IDs to identify different integrations.
30-
* See the example in the README for more details.
31-
*
32-
* This example will use the centralised account ID:
30+
* Replace the placeholder below with your actual account ID from the StackOne dashboard.
3331
*/
3432

3533
import process from 'node:process';
36-
import { ACCOUNT_IDS } from './constants';
3734

38-
const accountId = ACCOUNT_IDS.HRIS;
35+
// Replace with your actual account ID from StackOne dashboard
36+
const accountId = 'your-hris-account-id';
3937

4038
/**
4139
* # Quickstart

‎examples/meta-tools.ts‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@ import process from 'node:process';
1010
import { openai } from '@ai-sdk/openai';
1111
import { StackOneToolSet, Tools } from '@stackone/ai';
1212
import { generateText, stepCountIs } from 'ai';
13-
import { ACCOUNT_IDS } from './constants';
1413

1514
const apiKey = process.env.STACKONE_API_KEY;
1615
if (!apiKey) {
1716
console.error('STACKONE_API_KEY environment variable is required');
1817
process.exit(1);
1918
}
2019

20+
// Replace with your actual account ID from StackOne dashboard
21+
const accountId = 'your-hris-account-id';
22+
2123
/**
2224
* Example 1: Using meta tools with AI SDK for dynamic tool discovery
2325
*/
@@ -26,7 +28,7 @@ const metaToolsWithAISDK = async (): Promise<void> => {
2628

2729
// Initialise StackOne toolset
2830
const toolset = new StackOneToolSet({
29-
accountId: ACCOUNT_IDS.HRIS,
31+
accountId,
3032
baseUrl: process.env.STACKONE_BASE_URL ?? 'https://api.stackone.com',
3133
});
3234

@@ -64,7 +66,7 @@ const metaToolsWithOpenAI = async (): Promise<void> => {
6466

6567
// Initialise StackOne toolset
6668
const toolset = new StackOneToolSet({
67-
accountId: ACCOUNT_IDS.HRIS,
69+
accountId,
6870
baseUrl: process.env.STACKONE_BASE_URL ?? 'https://api.stackone.com',
6971
});
7072

@@ -118,7 +120,7 @@ const directMetaToolUsage = async (): Promise<void> => {
118120

119121
// Initialise toolset
120122
const toolset = new StackOneToolSet({
121-
accountId: ACCOUNT_IDS.HRIS,
123+
accountId,
122124
baseUrl: process.env.STACKONE_BASE_URL ?? 'https://api.stackone.com',
123125
});
124126

@@ -188,7 +190,7 @@ const dynamicToolRouter = async (): Promise<void> => {
188190
console.log('\n🔄 Example 4: Dynamic tool router\n');
189191

190192
const toolset = new StackOneToolSet({
191-
accountId: ACCOUNT_IDS.HRIS,
193+
accountId,
192194
baseUrl: process.env.STACKONE_BASE_URL ?? 'https://api.stackone.com',
193195
});
194196

‎examples/openai-integration.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,20 @@ import assert from 'node:assert';
66
import process from 'node:process';
77
import { StackOneToolSet } from '@stackone/ai';
88
import OpenAI from 'openai';
9-
import { ACCOUNT_IDS } from './constants';
109

1110
const apiKey = process.env.STACKONE_API_KEY;
1211
if (!apiKey) {
1312
console.error('STACKONE_API_KEY environment variable is required');
1413
process.exit(1);
1514
}
1615

16+
// Replace with your actual account ID from StackOne dashboard
17+
const accountId = 'your-hris-account-id';
18+
1719
const openaiIntegration = async (): Promise<void> => {
1820
// Initialise StackOne
1921
const toolset = new StackOneToolSet({
20-
accountId: ACCOUNT_IDS.HRIS,
22+
accountId,
2123
baseUrl: process.env.STACKONE_BASE_URL ?? 'https://api.stackone.com',
2224
});
2325

0 commit comments

Comments
 (0)