66 Commits

Author SHA1 Message Date
dexhorthy
22111fd908 Fix daemon integration test timing issues
Increase wait times from 200ms to 1s for daemon startup to ensure
the daemon has sufficient time to initialize SQLite database and
create its socket. Also adds stderr capture for better debugging
of failures and increases test timeout from 2s to 5s.

Fixes ENG-1625
2025-07-16 11:00:34 -05:00
Allison Durham
da079ca3b2 Complete InterruptSession implementation and enable resume during running status (#230)
* Complete InterruptSession implementation

- Fix syscall import compilation error in claudecode-go
- Add proper race condition handling in session manager
- Move InterruptSessionRequest to types.go for consistency
- Add InterruptSessionResponse with success/status fields
- Add 'completing' status for graceful shutdown semantics
- Update event publishing to use completing status
- Add TypeScript types for interrupt operations
- Update Rust client with proper response handling
- Fix unit tests for new completing status
- All 109 tests passing with full type safety

* git ignore test-results.json

* Enable resume during running status

- Allow continueSession to accept running sessions in addition to completed
- Interrupt running sessions before resuming to ensure clean state transitions
- Reorder validation to check claude_session_id before attempting interrupt
- Provide clear error messages for orphaned sessions (running but no claude_session_id)
- Add comprehensive unit and integration tests for new resume-during-running functionality
- Maintain backward compatibility for existing completed session resume workflow

* fix: force bash shell in CI to prevent shell compatibility errors

The CI was using /bin/sh which doesn't support bash-specific syntax
like [[ ]] used in hack/run_silent.sh lines 73 and 88. This caused
'/bin/sh: [[: not found' errors that made tests appear to pass when
they may not have actually run properly.

* add fail-fast shell syntax validation to prevent silent CI failures

- Added 'set -e' to hack/run_silent.sh to exit on any command failure
- Added 'bash -n' syntax validation before sourcing shell scripts in Makefile
- This ensures CI will fail immediately if shell scripts have syntax errors
- Prevents scenarios where malformed scripts cause tests to appear to pass
  when they may not have actually executed properly

* fix: resolve Claude Code streaming JSON schema compatibility issues

- Fix pointer-to-loop-variable bug in streaming test event collection
- Add missing system event fields (CWD, Model, PermissionMode, APIKeySource)
- Update Usage struct to match current Claude Code schema (ServerToolUse, ServiceTier)
- Fix cost field mapping from TotalCost to CostUSD throughout codebase
- Improve message event validation to handle user vs assistant differences
- All schema compatibility tests now pass

* fix: complete TotalCost to CostUSD field migration across codebase

- Remove deprecated TotalCost field assignments in session manager
- Update TUI to display CostUSD instead of TotalCost
- Remove TotalCost test assertions in result population tests
- Completes schema consistency with Claude Code SDK changes

* fix: make shell scripts POSIX-compliant to prevent CI failures

- Replace bash-specific [[ with POSIX [ syntax in run_silent.sh
- Replace == with = for POSIX compatibility
- Simplify test-ts to use run_silent instead of complex JSON parsing
- Remove SHELL := /bin/bash from all Makefiles (no longer needed)
- Remove shell: bash from GitHub Actions (no longer needed)
- Keep set -e for fail-fast behavior and syntax validation
- Scripts now work consistently in both bash and sh environments

* fix: use sh -n instead of bash -n for syntax validation

Since scripts are now POSIX-compliant, use sh for syntax validation
to match the target shell environment and ensure consistency.
2025-06-23 08:47:55 -07:00
dexhorthy
17e9efca6c wip 2025-06-17 09:29:57 -07:00
Dex
9ff57a773e Merge branch 'main' into release-0.7.9 2025-06-17 08:12:26 -07:00
Allison Durham
794d4d70fa cleaning up/refactoring of tui (#202)
* cleaning up/refactoring

* formatting cleanup

* rebind c to l to avoid vim l binding conflict

* change "prompt" to "query"

* no more agent name!
2025-06-06 15:49:19 -07:00
Sundeep Malladi
6862784c42 formatters ftw 2025-06-04 15:54:32 -05:00
dexhorthy
8ef6c30786 bump to next alpha 2025-06-03 13:37:26 -07:00
dexhorthy
136dcc001b release: v0.7.9 2025-06-03 13:30:15 -07:00
Sundeep Malladi
5e73d7a344 Allow channel overrides during escalation 2025-06-03 13:32:56 -05:00
dexhorthy
eac7d4e2e2 bump to next alpha 2025-05-29 08:58:50 -07:00
dexhorthy
e4fd91e504 release: v0.7.8 2025-05-29 08:54:45 -07:00
Sundeep Malladi
e940112f41 Rename hlyr to humanlayer; humanlayer to humanlayer-sdk 2025-05-28 15:31:21 -05:00
dexhorthy
f36d89554a initial tui impl 2025-05-27 09:13:54 -07:00
dexhorthy
3252dc0830 release: bump to next alpha 2025-04-14 16:15:26 -07:00
dexhorthy
7190c7b1c7 release: v0.7.7 2025-04-14 16:13:37 -07:00
dexhorthy
b1a3a17130 update-email 2025-04-14 09:21:57 -07:00
dexhorthy
b35b7ab4dd release: bump to next alpha 2025-03-23 11:27:28 -07:00
dexhorthy
3e04f40b1d release: v0.7.6 2025-03-23 11:27:05 -07:00
dexhorthy
d71a2e977f add message ts to status 2025-03-21 12:21:39 -07:00
dexhorthy
6c890d716c add thread ts and models to ts 2025-03-21 12:19:00 -07:00
dexhorthy
fc66619ffb release: bump to next alpha 2025-02-24 09:26:47 -08:00
dexhorthy
2e3abd9caa release: v0.7.5 2025-02-24 09:26:22 -08:00
Dex
1e3d57e398 Merge pull request #145 from dbentley/dbentley/update_function_call_ts_doc
add escalate_email support
2025-02-24 07:43:48 -08:00
Dan Bentley
1795fc7fbb add example 2025-02-21 12:02:16 -05:00
Dex
0d3e0f5dec Update examples/chainlit/app.py 2025-02-20 17:12:57 -08:00
dexhorthy
021149207b docs and examples updates for vercel, chainlit, and more
- Add [quickstart guide for using the humanlayer typescript sdk](https://humanlayer.dev/docs/quickstart-typescript)
- Add [guide for using Function Calls for Classification](https://humanlayer.dev/docs/core/classifications) with human-in-the-loop
- Add [framework guide for using humanlayer with chainlit](https://humanlayer.dev/docs/frameworks/chainlit)
- Add [framework guide for using humanlayer with the vercel ai sdk](https://humanlayer.dev/docs/frameworks/vercel-ai-sdk)
- Update [humanlayer-ts readme](https://github.com/humanlayer/humanlayer-ts) to include quickstart guide

- Add [example of a fullstack chat app with nextjs and the vercel ai sdk](https://github.com/humanlayer/humanlayer/tree/main/examples/vercel_ai_nextjs)
- Simplify the [chainlit example](https://github.com/humanlayer/humanlayer/tree/main/examples/chainlit) by using `AsyncHumanLayer`
- Update [langchain email example](https://github.com/humanlayer/humanlayer/tree/main/examples/langchain/09-email-contact.py) to showcase the use of custom jinja templates for email payloads
2025-02-20 17:08:43 -08:00
Dan Bentley
ce816f743c Add escalate email method 2025-02-20 17:41:47 -05:00
dexhorthy
866031e5e2 release: bump to next alpha 2025-01-21 20:21:04 -08:00
dexhorthy
c2fd8e6571 release: v0.7.4-alpha.2 2025-01-21 20:18:17 -08:00
dexhorthy
2a8c84dae3 rc testing done 2025-01-21 19:39:19 -08:00
dexhorthy
c5bf664103 changes locked 2025-01-21 16:04:11 -08:00
dexhorthy
e49d8dc987 agent-webhooks 2025-01-20 11:13:44 -08:00
dexhorthy
2375596a1e bump to next rc version 2025-01-17 10:25:09 -08:00
dexhorthy
3fe7235fea release: bump to next rc 2025-01-15 15:44:29 -06:00
dexhorthy
6849354405 release: v0.7.1 2025-01-15 15:42:59 -06:00
dexhorthy
a6191c6687 updates for 0.7.1 2025-01-15 15:20:56 -06:00
dexhorthy
6cc8a2bec5 working 2025-01-14 20:41:40 -06:00
dexhorthy
3cf8c9cac2 feat: Add Vercel AI SDK integration and improve timeout handling
**What I did**
- Added Vercel AI SDK integration for HumanLayer
- Improved HTTP timeout handling in Python and TypeScript SDKs
- Updated examples and documentation

**How I did it**
- Created new humanlayer-ts-vercel-ai-sdk package
- Added configurable timeout to Python and TypeScript SDKs
- Updated examples to use latest SDK versions
- Added new examples for Vercel AI SDK integration

**How to verify it**
- Run examples in ts_vercel_ai_sdk directory
- Check updated timeout handling in Python and TypeScript SDKs

**Description for the changelog**
Add Vercel AI SDK integration and improve timeout handling across SDKs
2025-01-14 18:11:33 -06:00
dexhorthy
a0484e2f43 vercel ai sdk alpha1 2025-01-05 01:30:31 -08:00
dexhorthy
b48ab4744a bump to rc versions 2025-01-04 23:42:25 -08:00
dexhorthy
bdb1332a2e ts 0.7.0, py 0.7.0
also, undo accidentally adding ts tests to CI (needs more changes post-release)
2025-01-04 23:40:34 -08:00
dexhorthy
7020b7e59a Simplify approval logic and improve TypeScript support
**A bunch of small fixes**
- TS - Fix a bug in fetchHumanApproval with callId resolution
- TS - remove env var for HUMANLAYER_APPROVAL_METHOD
- TS - add non-constructor entrypoint `import { humanlayer } from "humanlayer"`, `humanlayer(params)` is a wrapper around `new HumanLayer(params)`
- PY - AsyncHumanLayer.human_as_tool() is not async (but the tool it returns is)
- PY - remove env var for HUMANLAYER_APPROVAL_METHOD
- PY - remove all approval_method logic for AsyncHumanLayer - only backend is supported. Use a sync HumanLayer if you want to use the cli
- DEV - update makefile for building/testing TS more regularly

**How to verify it**

- Use the new constructor method instead of `new HumanLayer()` in Typescript
- Verify that the examples in ts_openai_client are no longer broken!

**Description for the changelog**
- TS - Fix a bug in fetchHumanApproval with callId resolution
- TS - remove env var for HUMANLAYER_APPROVAL_METHOD
- TS - add non-constructor entrypoint `import { humanlayer } from "humanlayer"`, `humanlayer(params)` is a wrapper around `new HumanLayer(params)`
- PY - AsyncHumanLayer.human_as_tool() is not async (but the tool it returns is)
- PY - remove env var for HUMANLAYER_APPROVAL_METHOD
- PY - remove all approval_method logic for AsyncHumanLayer - only backend is supported. Use a sync HumanLayer if you want to use the cli
- DEV - update makefile for building/testing TS more regularly
2025-01-04 23:20:27 -08:00
dexhorthy
fd88056946 add cl 2024-12-31 16:59:57 -05:00
dexhorthy
a17d0ca272 Update humanlayer to v0.6.1 and add module exports
- Updated `humanlayer` package to version `0.6.1`
- Added module exports in `package.json` to support both CommonJS and ES modules
- Improved handling of human contact and function call APIs by exposing lower level ts things

- Incorporated pkgroll for builds
- Modified `package.json` with `main`, `module`, `types`, and `exports` fields
- Refactored `src/approval.ts`, `src/cloud.ts`, `src/models.ts`, and `src/protocol.ts` for better API support
- Updated build scripts and `tsconfig.json` to output to the `dist` directory
- Ensured compatibility with both CommonJS and ES module systems

- [ ] I have ensured `make check test` passes

- Run `npm install` to update dependencies
- Build the package with `npm run build`
- Test the examples in the `examples/ts_langchain` folder
- Verify that the package works correctly in both CommonJS and ES module environments

* HumanLayer TS: Add more comprehensive module exports for CommonJS and ES modules
* HumanLayer TS: add lower-level create/fetch methods to typescript package
* HumanLayer TS: expand EmailContactChannel to support experimental subject and message id fields
2024-12-31 16:19:56 -05:00
dexhorthy
a3d286a7a7 Add state preservation support to FunctionCallSpec and HumanContactSpec
What I did
-----------

- Enabled state preservation in `FunctionCallSpec` and `HumanContactSpec`, allowing applications to maintain context across request lifecycles without storing state.
- Updated documentation and examples to demonstrate the new state preservation feature.

How I did it
-----------

- Added an optional `state` field to the models.
- Created new examples and updated existing ones to showcase state usage.
- Wrote tests to verify state is preserved across requests.
- Refactored session management in `async_cloud.py` for simplicity.
- [x] I have ensured `make check test` passes

How to verify it
-----------

- Run `make check test` to ensure all tests pass.
- Review the `app-statehooks.py` example for state preservation without webhooks.
- Check the updated documentation under the **State Preservation** section.

Description for the changelog
--------------

- Add state preservation support to `FunctionCallSpec` and `HumanContactSpec`, enabling applications to maintain context across requests without storing state.
2024-12-18 13:52:00 -08:00
dexhorthy
7b273eacac update examples versions 2024-11-05 00:51:42 -08:00
dexhorthy
9b217a7092 bump versions 2024-11-05 00:49:24 -08:00
dexhorthy
06c18da61e v0.6.0 2024-11-05 00:48:54 -08:00
dexhorthy
b48ee32ab5 updates to examples 2024-11-05 00:42:59 -08:00
dexhorthy
0ba9d0954b merge from main 2024-11-04 20:04:55 -08:00