pi2web 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,38 @@
1
+ openapi: 3.1.0
2
+ info: {title: Remote Pi API, version: 1.0.0}
3
+ servers: [{url: /api/v1}]
4
+ security: [{bearerAuth: []}]
5
+ paths:
6
+ /system/status:
7
+ get: {operationId: systemStatus, responses: {'200': {$ref: '#/components/responses/Success'}}}
8
+ /workspaces:
9
+ get: {operationId: listWorkspaces, responses: {'200': {$ref: '#/components/responses/Success'}}}
10
+ post: {operationId: addWorkspace, requestBody: {$ref: '#/components/requestBodies/Json'}, responses: {'201': {$ref: '#/components/responses/Success'}}}
11
+ /workspaces/{id}/tree:
12
+ get: {operationId: workspaceTree, parameters: [{$ref: '#/components/parameters/Id'}, {name: path, in: query, schema: {type: string}}], responses: {'200': {$ref: '#/components/responses/Success'}}}
13
+ /workspaces/{id}/stat:
14
+ get: {operationId: workspaceStat, parameters: [{$ref: '#/components/parameters/Id'}, {name: path, in: query, schema: {type: string}}], responses: {'200': {$ref: '#/components/responses/Success'}}}
15
+ /workspaces/{id}/file:
16
+ get: {operationId: workspaceFile, parameters: [{$ref: '#/components/parameters/Id'}, {name: path, in: query, schema: {type: string}}, {name: offset, in: query, schema: {type: integer}}, {name: limit, in: query, schema: {type: integer, maximum: 1048576}}], responses: {'200': {$ref: '#/components/responses/Success'}}}
17
+ /sessions:
18
+ get: {operationId: listSessions, parameters: [{name: workspaceId, in: query, required: true, schema: {type: string}}, {name: path, in: query, schema: {type: string}}], responses: {'200': {$ref: '#/components/responses/Success'}}}
19
+ /agents:
20
+ get: {operationId: listAgents, responses: {'200': {$ref: '#/components/responses/Success'}}}
21
+ post: {operationId: createAgent, requestBody: {$ref: '#/components/requestBodies/Json'}, responses: {'201': {$ref: '#/components/responses/Success'}}}
22
+ /agents/{id}/{action}:
23
+ get: {operationId: getAgentResource, parameters: [{$ref: '#/components/parameters/Id'}, {name: action, in: path, required: true, schema: {enum: [state,messages,capabilities,session]}}], responses: {'200': {$ref: '#/components/responses/Success'}}}
24
+ post: {operationId: agentCommand, parameters: [{$ref: '#/components/parameters/Id'}, {name: action, in: path, required: true, schema: {enum: [prompt,steer,follow-up,abort,compact,model,thinking,session-name,navigate,fork,extension-response]}}], requestBody: {$ref: '#/components/requestBodies/Json'}, responses: {'200': {$ref: '#/components/responses/Success'}}}
25
+ components:
26
+ securitySchemes: {bearerAuth: {type: http, scheme: bearer}}
27
+ parameters:
28
+ Id: {name: id, in: path, required: true, schema: {type: string}}
29
+ requestBodies:
30
+ Json: {required: true, content: {application/json: {schema: {type: object}}}}
31
+ responses:
32
+ Success: {description: Successful response, content: {application/json: {schema: {type: object, required: [data], properties: {data: {}}}}}}
33
+ Error: {description: Error, content: {application/json: {schema: {$ref: '#/components/schemas/ErrorEnvelope'}}}}
34
+ schemas:
35
+ ErrorEnvelope:
36
+ type: object
37
+ required: [error]
38
+ properties: {error: {type: object, required: [code,message,requestId], properties: {code: {type: string}, message: {type: string}, requestId: {type: string}}}}
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://remote-pi.local/protocol/v1/websocket.schema.json",
4
+ "title": "Remote Pi WebSocket v1",
5
+ "oneOf": [
6
+ {"$ref":"#/$defs/subscribe"}, {"$ref":"#/$defs/command"}, {"$ref":"#/$defs/subscribed"},
7
+ {"$ref":"#/$defs/commandResult"}, {"$ref":"#/$defs/agentEvent"}, {"$ref":"#/$defs/agentSnapshot"}
8
+ ],
9
+ "$defs": {
10
+ "subscribe": {"type":"object","additionalProperties":false,"required":["type","agentId"],"properties":{"type":{"const":"subscribe"},"agentId":{"type":"string"},"lastSequence":{"type":"integer","minimum":0},"fromNow":{"type":"boolean"}}},
11
+ "command": {"type":"object","additionalProperties":false,"required":["type","requestId","agentId"],"properties":{"type":{"enum":["prompt","steer","follow-up","abort"]},"requestId":{"type":"string"},"agentId":{"type":"string"},"message":{"type":"string","maxLength":2097152}}},
12
+ "subscribed": {"type":"object","required":["type","agentId","protocolVersion"],"properties":{"type":{"const":"subscribed"},"agentId":{"type":"string"},"protocolVersion":{"const":1},"currentSequence":{"type":"integer","minimum":0}}},
13
+ "commandResult": {"type":"object","required":["type","success"],"properties":{"type":{"const":"command_result"},"requestId":{"type":"string"},"success":{"type":"boolean"},"error":{"type":"object"}}},
14
+ "agentEvent": {"type":"object","required":["type","agentId","eventId","sequence","event"],"properties":{"type":{"const":"agent_event"},"agentId":{"type":"string"},"eventId":{"type":"string"},"sequence":{"type":"integer","minimum":1},"timestamp":{"type":"integer","minimum":0},"event":{"type":"object","required":["type"]}}},
15
+ "agentSnapshot": {"type":"object","required":["type","agentId","lastSequence","state","messages"],"properties":{"type":{"const":"agent_snapshot"},"agentId":{"type":"string"},"lastSequence":{"type":"integer","minimum":0},"state":{"type":"object"},"messages":{"type":"array"}}}
16
+ }
17
+ }