Skip to content

SDKs: stream-json, Node 18, and publishing to PyPI and npm #21

Closed

Description

@blockmandev

Why

sdk/python (incode_sdk, stdlib only, 3.9+) and sdk/typescript (@incord/incode-sdk, Node 18+, no runtime deps) are done and tested against a shared fake (sdk/testing/fake_incode.py) and the real binary. They aren't published, and a few pieces are missing.

Steps (local)

python3 -m unittest discover sdk/python/tests
cd sdk/typescript && npm install && npm test
INCODE_BIN=$PWD/target/debug/incode python3 -m unittest discover sdk/python/tests   # live test
python3 sdk/examples/python_example.py ; node sdk/examples/typescript_example.mjs

To build

  • Wrap incode -t ... --output-format stream-json as a streaming run_task / runTask: one event per line, then the final result object. Today only json is wrapped.
  • Test on Node 18 (only 20 and 22 were run).
  • Agent→client terminal/* requests and elicitation (answered "method not found" today).
  • A fuller session/list helper.
  • Publish:
    • Python: a PyPI project, python -m build then twine upload, or trusted publishing from a tagged workflow.
    • TypeScript: the npm org @incord, then npm publish --access public from sdk/typescript after npm run build.
    • Add a release job for each.

Notes on incode's behaviour the SDKs rely on


Generated by Claude Code

Activity

  1. blockmandev commented on Oct 22, 2026

    @blockmandev
    MemberAuthor

    Done in #47 (merged):

    • Streaming one-shot runs. Python stream_task(...) / TaskStream and TypeScript streamTask(...) deliver each stream-json event (init, text, thinking, notice, tool_use, tool_result, usage) as it arrives, then the result, with the same errors run_task/runTask raise.
    • Node 18 tested. CI now runs the SDKs on Node 18 with Python 3.9 (on ubuntu-22.04, since ubuntu-latest is now 26.04 and has no Python 3.9 build), and on Node 20 and 22.

    Intentionally not built: terminal/* and elicitation. incode never sends terminal/* requests to a client. It deliberately doesn't send elicitation either: see src/acp_agent/permission.rs:11-15. Questions are reported to the model as unanswered, because clients answer elicitation with "method not supported". So the SDKs answering "method not found" is correct for everything incode does, and handlers would be dead code. If incode ever starts sending them, the SDKs should follow.

    Next: a typed session/list helper, listing this workspace's sessions or every workspace's (branch feat/sdk-sessions, coming as its own PR).

    Needs your accounts: publishing to PyPI and npm.

  2. added 2 commits that reference this issue on Oct 22, 2026
  3. blockmandev commented on Oct 22, 2026

    @blockmandev
    MemberAuthor

    The typed session/list helper is done in #48 (merged). Python Session.sessions(all_workspaces=False) and TypeScript session.sessions({ allWorkspaces }) return typed SessionInfo (id, cwd, title, last updated), newest first, for this workspace or every workspace. list_sessions / listSessions are unchanged.

    That finishes this issue's code items:

    • streaming;
    • Node 18 (and Python 3.9) in CI;
    • the sessions helper;
    • terminal/* and elicitation, intentionally not built (see the comment above).

    What's left is publishing, which needs your PyPI project and the @incord npm org: python -m build + twine upload (or trusted publishing), and npm publish --access public.

  4. blockmandev commented on Oct 23, 2026

    @blockmandev
    MemberAuthor

    Solved: streaming in #47, typed sessions in #48, Node 18 and Python 3.9 tested in CI. Both SDKs are tested against the fake agent and the real binary. Publishing to PyPI and npm moved to #56 (it needs the owner's accounts).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions