@pstdio/pocketcoder-sdk 0.9.0 → 0.11.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.
- package/README.md +19 -18
- package/dist/index.d.ts +1347 -2149
- package/dist/index.js +164 -206
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -58,30 +58,31 @@ Applications that use PocketCoder as their agent runtime work with logical sessi
|
|
|
58
58
|
and never name a workspace. PocketCoder places, replaces and stops compute itself.
|
|
59
59
|
|
|
60
60
|
```ts
|
|
61
|
-
const session = await client.sessions.create({ sessionId,
|
|
62
|
-
const file = await client.
|
|
63
|
-
//
|
|
64
|
-
const body = { requestId, message: "Summarize the notes", attachments: [file.reference]
|
|
61
|
+
const session = await client.sessions.create({ sessionId, profile: "chat", owner: "user-42" });
|
|
62
|
+
const file = await client.sessions.upload(session.sessionId, { inputId, name: "notes.txt", mediaType: "text/plain", bytes });
|
|
63
|
+
// Keep this body for a retry after a lost reply.
|
|
64
|
+
const body = { requestId, message: "Summarize the notes", attachments: [file.reference.inputId] };
|
|
65
65
|
await client.requests.submit(session.sessionId, body);
|
|
66
|
-
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
// Delivered at least once: skip resource revisions you already applied, keep event.cursor.
|
|
70
|
-
}
|
|
66
|
+
const feed = await client.sessions.conversation(session.sessionId);
|
|
67
|
+
const changes = await client.sessions.conversation(session.sessionId, { after: feed.cursor });
|
|
68
|
+
// Replace the local view when changes.reset is true; otherwise apply the changed items.
|
|
71
69
|
```
|
|
72
70
|
|
|
73
71
|
| Resource | Methods |
|
|
74
72
|
| --- | --- |
|
|
75
|
-
| `client.
|
|
73
|
+
| `client.profiles` | `get` |
|
|
74
|
+
| `client.sessions` | `create`, `get`, `list`, `resume`, `cancel`, `close`, `upload`, `conversation`, `history`, `snapshot`, `events`, `openPreview` |
|
|
76
75
|
| `client.requests` | `submit`, `get`, `cancel`, `collection` |
|
|
77
|
-
| `client.files` | `put`, `
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
76
|
+
| `client.files` | `put`, `get`, `exports`, `content` |
|
|
77
|
+
|
|
78
|
+
Profiles and issuer policy are configured by the operator in the principal file.
|
|
79
|
+
Applications only need session read/write grants. Owner limits span groups and
|
|
80
|
+
releases; the controller places and drains compute.
|
|
81
|
+
|
|
82
|
+
`conversation` returns tagged message and request changes. Its cursor resets after
|
|
83
|
+
controller restart. `events` and `history` remain available for retained exports.
|
|
84
|
+
Cancel and close take no body and return a receipt that stays `pending` until the
|
|
85
|
+
stop has evidence. Retry the same call. See the
|
|
85
86
|
[reference consumer](../../examples/clients/managed-runtime/README.md).
|
|
86
87
|
|
|
87
88
|
## Resolve one user turn after preservation
|