@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.
Files changed (4) hide show
  1. package/README.md +19 -18
  2. package/dist/index.d.ts +1347 -2149
  3. package/dist/index.js +164 -206
  4. 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, profileId, profileRevision: 1 });
62
- const file = await client.files.put(session.sessionId, { inputId, name: "notes.txt", mediaType: "text/plain", bytes });
63
- // Store this body before sending it. After a lost reply, send the identical body again.
64
- const body = { requestId, message: "Summarize the notes", attachments: [file.reference], dispatchDeadline };
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 { records, eventCursor } = await client.sessions.snapshot(session.sessionId);
68
- for await (const event of client.sessions.events(session.sessionId, { after: eventCursor, signal })) {
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.sessions` | `create`, `get`, `resume`, `close`, `history`, `snapshot`, `events`, `openPreview` |
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`, `register`, `upload`, `get`, `exports`, `content` |
78
- | `client.authority` | `grantScope`, `putPolicy`, `getPolicy`, `usage`, `putProfile`, `putCredentialBinding` |
79
-
80
- `events` resumes after the last delivered cursor (also sent as `Last-Event-ID`) when a
81
- stream ends. It throws `events.cursor_expired` when the cursor is no longer retained:
82
- read a new snapshot and follow its `eventCursor`. `cancel` and `close` return a receipt
83
- that stays `pending` until the stop has evidence; retry with the same `cancelId`.
84
- Budgets cover physical capacity only; model usage belongs to the model gateway. See the
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