Initial Agentsd project commit

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-09 15:09:56 +08:00
commit 1bf1f08f9a
41 changed files with 8106 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
"""Quick test: call Claude Code plugin's chat export."""
import json
import sys
from pathlib import Path
sys.path.insert(0, str(Path(__file__).parent.parent / "_sdk"))
import grpc
import agentsd_pb2 as pb
import agentsd_pb2_grpc as rpc
def main():
# Connect to claudecode plugin's callback server
channel = grpc.insecure_channel("localhost:50053")
bridge = rpc.PluginBridgeStub(channel)
# Call "chat"
args = json.dumps({"prompt": "What is 2+2? Reply with just the number."}).encode()
resp = bridge.Call(pb.CallRequest(target="claudecode", fn="chat", args=args))
print(f"ok={resp.ok}")
if resp.result:
result = json.loads(resp.result)
print(f"result: {result.get('result', result.get('error', ''))}")
channel.close()
if __name__ == "__main__":
main()