Skip to content

SDK: add upload(), file_status(), and delete_file() methods to REST client #1

Description

@parag

Summary

Three SDK methods were implemented locally on a private branch and have been reverted as unauthorized work. Refile here so they can be rebuilt cleanly against the approved codebase.

Methods to implement

upload(path, content)

Single-file upload via POST /v1/files. Complements the existing folder-sync flow.

Suggested signature:

def upload(self, path: str, content: Union[str, bytes]) -> dict:
    """Upload a single file. Returns {id, status}."""

file_status(path)

Per-file indexing status via GET /v1/files/:path/status. Useful for polling a single file without walking the full manifest.

Suggested signature:

def file_status(self, path: str) -> dict:
    """Returns {path, state, progress?}. state is one of:
    'pending', 'indexing', 'ready', 'failed'."""

Known gotcha during local implementation: server may return section state with inconsistent casing. Comparison on the client should be case-insensitive.

delete_file(path)

File delete via DELETE /v1/files/:path. Cascade-deletes associated memories.

Suggested signature:

def delete_file(self, path: str) -> dict:
    """Returns {deleted, removed_memories}."""

Implementation location

src/hebbs/rest_client.py — add the three methods next to the existing file-sync methods. About 80 LOC total based on the reverted patch.

Cross-repo tracking

  • Server endpoints live in the private hebbs-platform service.
  • Matching TypeScript SDK methods: see hebbs-ai/hebbs-typescript companion issue.
  • Docs: see hebbs-ai/hebbs-docs companion issue.

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