Skip to main content

Agent-side SDK + CLI for the Handshake Prompt Protocol

Project description

handshake-prompt-agent

Agent-side SDK + CLI for the Handshake Prompt Protocol (HPP). Zero external dependencies (Python stdlib only).

Install

pip install handshake-prompt-agent

CLI

# Extract credentials from a handshake prompt
handshake-prompt-agent parse-prompt --prompt "$(pbpaste)"

# Get current schema + values
handshake-prompt-agent get-context --sid <sid> --token <token> --base <url>

# Submit field values
handshake-prompt-agent action --sid <sid> --token <token> --base <url> \
    --data '{"name":"Alice","age":30}'

# Get incremental changes since last submit
handshake-prompt-agent get-diff --sid <sid> --token <token> --base <url> \
    --since "2026-06-23T10:22:00+08:00"

Programmatic API

from handshake_prompt_agent import HandshakeAgent, parse_prompt

# Parse user-pasted prompt
creds = parse_prompt(prompt_text)
agent = HandshakeAgent(
    sid=creds['sessionId'],
    token=creds['token'],
    base_url=creds['baseUrl'],
)

# Read current state (call this BEFORE every action!)
state = agent.get_context()
print(state['schema'])     # field definitions
print(state['context'])    # current values + who filled (user/ai/empty/user_edit)
print(state['missing'])    # required-but-empty keys

# Apply values
result = agent.action({
    'name':  'Alice',
    'email': 'alice@example.com',
    'age':   30,
})
print(result['applied'])   # fields successfully written
print(result['rejected'])  # fields blocked (e.g. user already filled)
print(result['context'])   # full state snapshot after the action

Skill integration

This package is intended to be used inside an Agent skill (e.g. Codemaker, Claude, Cursor). A typical skill file:

# my-handshake-skill SKILL.md

Triggered when user pastes a message containing `sessionId:` and `token:`.

Workflow:
1. parse-prompt to extract credentials
2. get-context to read current schema + values
3. reason out field values based on user's request
4. action to submit values

Always call get-context BEFORE each action to see latest state
(user may have edited fields manually).

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

handshake_prompt_agent-0.1.0.tar.gz (5.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

handshake_prompt_agent-0.1.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file handshake_prompt_agent-0.1.0.tar.gz.

File metadata

  • Download URL: handshake_prompt_agent-0.1.0.tar.gz
  • Upload date:
  • Size: 5.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for handshake_prompt_agent-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ee32d46b19008ab326a41ee91a7c942dc0d44559a683b4972680ee027efdcce2
MD5 fda7803c4b89eb2b5bb5a2780dd2f56e
BLAKE2b-256 7d5a1c67b22b1cba31e2ae121260decf7a4faf1a0f5cf1f34bda206eb2df1d75

See more details on using hashes here.

File details

Details for the file handshake_prompt_agent-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for handshake_prompt_agent-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 26a77ad46f3132135a9c7888987a3efe03049900b6cd9ab36f873e095b6c2338
MD5 885964a9dc390c6e0842729fb9904584
BLAKE2b-256 5bc656f17ee69fa7754bcd3e880d81da8ba5b8b9086128d975b1778198055d32

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page