Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: StackOneHQ/stackone-ai-node
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: StackOneHQ/stackone-ai-node
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: codemode
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 15 commits
  • 53 files changed
  • 1 contributor

Commits on Nov 27, 2025

  1. Configuration menu
    Copy the full SHA
    733c8f4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7e2b90f View commit details
    Browse the repository at this point in the history
  3. feat: add codegen and DynamicToolClient for typed SDK generation

    Introduce core infrastructure for generating typed TypeScript SDK files:
    
    - src/codegen.ts: Code generation utilities that convert fetched tools
      into TypeScript interfaces and wrapper functions. Generates both
      types.d.ts (type definitions) and index.ts (implementation) files.
    
    - src/dynamic-client.ts: Lightweight RPC client for executing tools
      via the StackOne /actions/rpc endpoint. Used by generated SDK files
      to execute tools with proper authentication and request formatting.
    
    Key features:
    - JSON Schema to TypeScript type conversion
    - Automatic interface generation from tool parameters
    - PascalCase/camelCase naming conventions
    - Support for enum, oneOf, anyOf, allOf schemas
    - Optional parameter handling
    ryoppippi committed Nov 27, 2025
    Configuration menu
    Copy the full SHA
    e700e7b View commit details
    Browse the repository at this point in the history
  4. feat: integrate generateTypedClient into StackOneToolSet

    Add generateTypedClient() method to StackOneToolSet that fetches tools
    and generates typed TypeScript SDK files. This provides a convenient
    API for generating account-specific typed clients.
    
    Changes:
    - Export generateTypedClientContent, GenerateTypedClientOptions from codegen
    - Export DynamicToolClient, DynamicToolClientConfig from dynamic-client
    - Add StackOneToolSet.generateTypedClient() method that:
      - Fetches tools using existing fetchTools() infrastructure
      - Generates types.d.ts and index.ts files via writeTypedClientFiles()
      - Returns generated file paths and content
    ryoppippi committed Nov 27, 2025
    Configuration menu
    Copy the full SHA
    667d1c1 View commit details
    Browse the repository at this point in the history
  5. refactor: move generate-dynamic-tools script to examples/

    Relocate the dynamic tools generation script from scripts/ to examples/
    to better reflect its purpose as a usage example rather than a build
    script.
    
    The script demonstrates how to use StackOneToolSet.generateTypedClient()
    to create typed TypeScript SDKs from tools fetched via MCP. It now uses
    the new integrated API instead of directly calling codegen functions.
    ryoppippi committed Nov 27, 2025
    Configuration menu
    Copy the full SHA
    b3fbb85 View commit details
    Browse the repository at this point in the history
  6. chore: update env example and lockfile

    - Add STACKONE_ACCOUNT_IDS to .env_example for typed SDK generation
    - Update bun.lock with dependency changes
    ryoppippi committed Nov 27, 2025
    Configuration menu
    Copy the full SHA
    4a4d05b View commit details
    Browse the repository at this point in the history
  7. fix: use import type for DynamicToolClient in generated index.ts

    DynamicToolClient is only used as a type annotation in generated
    wrapper functions, so use import type for proper type-only imports.
    ryoppippi committed Nov 27, 2025
    Configuration menu
    Copy the full SHA
    26233ba View commit details
    Browse the repository at this point in the history
  8. chore: add perfromance

    ryoppippi committed Nov 27, 2025
    Configuration menu
    Copy the full SHA
    f38bb35 View commit details
    Browse the repository at this point in the history
  9. refactor: use untyped for TypeScript type generation

    Replace custom JSON Schema to TypeScript conversion with the `untyped`
    library for more reliable and better-formatted type generation.
    
    Benefits:
    - Proper JSDoc comment formatting with multi-line support
    - Nested object properties get their own JSDoc descriptions
    - Better indentation and readability
    - @required tags for required properties
    - Maintained enum simplification (>20 values → base type)
    
    Changes:
    - Add untyped dependency for schema processing
    - Rewrite codegen.ts to convert JSON Schema to untyped input format
    - Make generateTypedClientContent async (untyped uses async resolution)
    - Update stackone.ts to await the now-async generation
    ryoppippi committed Nov 27, 2025
    Configuration menu
    Copy the full SHA
    94744c9 View commit details
    Browse the repository at this point in the history
  10. feat: add direct REST API support for unified actions in DynamicToolC…

    …lient
    
    The RPC endpoint (/actions/rpc) does not support unified API actions
    (prefixed with 'unified_'). This change adds automatic detection and
    routing for unified actions to call the REST API directly instead.
    
    The parseUnifiedAction function converts action names to HTTP methods
    and URL paths:
    - unified_hris_list_employees -> GET /unified/hris/employees
    - unified_hris_get_employees -> GET /unified/hris/employees/{id}
    - unified_hris_create_employees -> POST /unified/hris/employees
    - unified_hris_update_employees -> PATCH /unified/hris/employees/{id}
    - unified_hris_list_employees_documents -> GET /unified/hris/employees/{id}/documents
    
    Non-unified actions continue to use the RPC endpoint as before.
    ryoppippi committed Nov 27, 2025
    Configuration menu
    Copy the full SHA
    799680f View commit details
    Browse the repository at this point in the history
  11. feat(examples): add AI-powered code generation example using typed SDK

    Added ai-code-generation.ts example that demonstrates:
    - Generating typed client files from StackOne tool catalog via generateTypedClient()
    - Using Claude (Haiku 4.5) with structured output (Zod schema) for code generation
    - Executing generated TypeScript code against StackOne APIs
    
    Key improvements in code quality:
    - Uses Bun.env with type-safe module augmentation instead of process.env
    - Uses generateObject() from Vercel AI SDK for structured JSON output, eliminating
      markdown code block parsing hacks
    - Proper Zod schema validation for generated code structure
    - Cleaner environment variable handling with nullish coalescing (??)
    
    The example showcases the full workflow: typed client generation → AI code
    generation with structured output → code execution and result display.
    ryoppippi committed Nov 27, 2025
    Configuration menu
    Copy the full SHA
    0f137e9 View commit details
    Browse the repository at this point in the history
  12. fix: handle nested query parameters in buildQueryString

    Change buildQueryString to recursively handle nested objects like
    filter parameters. Instead of JSON.stringify, now uses bracket
    notation (e.g., filter[updated_after]=xxx) which is the expected
    format for the StackOne API.
    ryoppippi committed Nov 27, 2025
    Configuration menu
    Copy the full SHA
    1b01353 View commit details
    Browse the repository at this point in the history

Commits on Nov 28, 2025

  1. feat(examples): improve ai-code-generation with caching and run history

    - Add caching for typed client generation (skip if files exist)
    - Add --no-cache flag to force regeneration
    - Save run history with timestamps (generated code + output JSON)
    - Remove explanation field from schema (reduce tokens)
    - Remove baseUrl fallback from prompt (reduce tokens)
    - Clean up temporary _generated-code.ts after execution
    - Switch from Sonnet 4.5 to Haiku 4.5 for code generation
    - Add sample runs from test account (421095649644)
    - Exclude generated-dynamic-tools from biome linting
    ryoppippi committed Nov 28, 2025
    Configuration menu
    Copy the full SHA
    6402ef7 View commit details
    Browse the repository at this point in the history
  2. new example

    ryoppippi committed Nov 28, 2025
    Configuration menu
    Copy the full SHA
    2336ddc View commit details
    Browse the repository at this point in the history
  3. feat(examples): add parallel API call example for ai-code-generation

    Add run example demonstrating Promise.all for fetching department groups
    and work locations simultaneously with summary generation.
    
    Query: "Get all department groups and all work locations in parallel,
    then show a summary"
    ryoppippi committed Nov 28, 2025
    Configuration menu
    Copy the full SHA
    77aa59d View commit details
    Browse the repository at this point in the history
Loading