@ravi-os/sdk 0.260519.1 → 0.260519.2

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 CHANGED
@@ -136,18 +136,60 @@ const recentTasks = await ravi.tasks.list({
136
136
  });
137
137
  ```
138
138
 
139
- ### Send A Prompt To A Session
139
+ ### Manage Agents
140
140
 
141
141
  ```ts
142
- const result = await ravi.sessions.send("main", "What changed in the repo?", {
142
+ // List all agents
143
+ const agents = await ravi.agents.list({ limit: "50" });
144
+
145
+ // Create a new agent rooted at a workspace directory
146
+ await ravi.agents.create("support", "/home/luis/ravi/support");
147
+
148
+ // Inspect and tune
149
+ await ravi.agents.show("support");
150
+ await ravi.agents.set("support", "model", "claude-opus-4-7");
151
+ await ravi.agents.debounce("support", "3000"); // ms
152
+
153
+ // Inspect or reset the agent's primary session
154
+ await ravi.agents.session("support");
155
+ await ravi.agents.reset("support");
156
+
157
+ // Remove an agent permanently
158
+ await ravi.agents.delete("support");
159
+ ```
160
+
161
+ ### Drive Sessions
162
+
163
+ ```ts
164
+ // List sessions for one agent, with live runtime snapshot
165
+ await ravi.sessions.list({ agent: "support", live: true, limit: "20" });
166
+
167
+ // Send a prompt and wait for the structured response
168
+ const result = await ravi.sessions.send("support", "Resumo do dia.", {
143
169
  wait: true,
144
170
  });
145
171
 
146
- console.log(result);
172
+ // Walk the message history
173
+ const history = await ravi.sessions.read("support", { count: "10" });
174
+
175
+ // Hand off between sessions (fire-and-forget). Sessions can ask, inform,
176
+ // and answer one another — the runtime delivers as system messages.
177
+ await ravi.sessions.ask("support", "Conseguiu rodar o build?", "agent:main");
178
+ await ravi.sessions.inform("support", "Daemon reiniciado às 11:20.");
179
+ await ravi.sessions.answer("support", "Build OK em 12s.", "agent:main");
180
+
181
+ // Steer / interrupt / rollback the active runtime turn
182
+ await ravi.sessions.runtime.interrupt("support");
183
+ await ravi.sessions.runtime.steer("support", "Mais conciso, por favor.");
184
+ await ravi.sessions.runtime.rollback("support", "1"); // undo last turn
185
+
186
+ // Lifecycle
187
+ await ravi.sessions.reset("support");
188
+ await ravi.sessions.delete("support");
147
189
  ```
148
190
 
149
- `wait: true` maps to the CLI's `--wait`. Without it, the command is
150
- fire-and-forget.
191
+ `wait: true` maps to the CLI's `--wait`. Without it, `send` returns immediately
192
+ and the session processes the prompt in the background.
151
193
 
152
194
  ### Stream Session Events
153
195
 
@@ -187,10 +229,48 @@ Streams always require a valid context key and the matching scope, such as
187
229
  `view:system:events`, `view:system:tasks`, `access:session:<name>`, or
188
230
  `view:system:audit`.
189
231
 
190
- ### Work With Contacts And CRM
232
+ ### Manage Contacts
233
+
234
+ ```ts
235
+ // Approval queue: incoming DMs land here until you allow them
236
+ const pending = await ravi.contacts.pending();
237
+ await ravi.contacts.approve("contact_5511…", "auto", { agent: "support" });
238
+
239
+ // Or add a contact manually (also acts as allow)
240
+ await ravi.contacts.add("+5511999999999", "Alice", {
241
+ kind: "person",
242
+ agent: "support",
243
+ });
244
+
245
+ // Browse and drill into a contact
246
+ const list = await ravi.contacts.list({ status: "approved", limit: "50" });
247
+ const card = await ravi.contacts.profile("contact_123", { includeCrm: true });
248
+ const recent = await ravi.contacts.messages("contact_123", { limit: "20" });
249
+
250
+ // Tag, untag, find by tag
251
+ await ravi.contacts.tag("contact_123", "lifecycle:active");
252
+ await ravi.contacts.untag("contact_123", "lifecycle:new");
253
+ const matches = await ravi.contacts.find("lifecycle:active", { tag: true });
254
+
255
+ // Scoped custom metadata (one row per source)
256
+ await ravi.contacts.metadata.set("contact_123", "billing_id", "cus_42", {
257
+ scope: "stripe",
258
+ source: "dashboard",
259
+ });
260
+
261
+ // Append a note to the contact timeline
262
+ await ravi.contacts.note("contact_123", "Cliente pediu desconto em call.", {
263
+ source: "crm",
264
+ });
265
+
266
+ // Moderation
267
+ await ravi.contacts.block("contact_spam");
268
+ ```
269
+
270
+ CRM-specific helpers (accounts, opportunities, lifecycle facts) live under
271
+ `ravi.crm.*`:
191
272
 
192
273
  ```ts
193
- const contacts = await ravi.contacts.list({ limit: "20" });
194
274
  const crmCards = await ravi.crm.contacts({ limit: "20" });
195
275
  const nextActions = await ravi.crm.next({ owner: "agent:main", limit: "10" });
196
276
 
@@ -199,6 +279,37 @@ await ravi.crm.contact.set("contact_123", "lifecycle", "active", {
199
279
  });
200
280
  ```
201
281
 
282
+ ### Tag Anything
283
+
284
+ Ravi tags are first-class. The same tag slug can bind contacts, sessions,
285
+ agents, projects, tasks, chats, instances, artifacts, and more — Ravi
286
+ maintains the inverse index so you can query the graph from either end.
287
+
288
+ ```ts
289
+ // Define the tag once
290
+ await ravi.tags.create("priority:high", {
291
+ label: "High priority",
292
+ kind: "user",
293
+ });
294
+
295
+ // Attach to any target type — the option key picks the binding
296
+ await ravi.tags.attach("priority:high", { contact: "contact_123" });
297
+ await ravi.tags.attach("priority:high", { session: "support" });
298
+ await ravi.tags.attach("priority:high", { chat: "5511999@s.whatsapp.net" });
299
+ await ravi.tags.attach("priority:high", { task: "task_42" });
300
+
301
+ // Search bindings — pivot from tag to all assets, or from one asset to its tags
302
+ const tagged = await ravi.tags.search({ tag: "priority:high", limit: "100" });
303
+ const onContact = await ravi.tags.search({ contact: "contact_123" });
304
+
305
+ // Browse the catalog
306
+ await ravi.tags.list({ kind: "user", query: "lifecycle" });
307
+ await ravi.tags.show("priority:high");
308
+
309
+ // Detach (mirror of attach)
310
+ await ravi.tags.detach("priority:high", { contact: "contact_123" });
311
+ ```
312
+
202
313
  ### Create And Version Artifacts
203
314
 
204
315
  ```ts
package/dist/version.d.ts CHANGED
@@ -3,5 +3,5 @@ export declare const SDK_VERSION = "0.2.1";
3
3
  /** SHA-256 fingerprint of the registry projection at codegen time. */
4
4
  export declare const REGISTRY_HASH = "sha256:7b4e32b3cc40b554c4425c747932c2c0d4356fca88ee96cecc0531c069e6285e";
5
5
  /** Git SHA of the source tree at codegen time. `"unknown"` outside git. */
6
- export declare const GIT_SHA = "c394681a35b4";
6
+ export declare const GIT_SHA = "217625846a59";
7
7
  //# sourceMappingURL=version.d.ts.map
package/dist/version.js CHANGED
@@ -6,5 +6,5 @@ export const SDK_VERSION = "0.2.1";
6
6
  /** SHA-256 fingerprint of the registry projection at codegen time. */
7
7
  export const REGISTRY_HASH = "sha256:7b4e32b3cc40b554c4425c747932c2c0d4356fca88ee96cecc0531c069e6285e";
8
8
  /** Git SHA of the source tree at codegen time. `"unknown"` outside git. */
9
- export const GIT_SHA = "c394681a35b4";
9
+ export const GIT_SHA = "217625846a59";
10
10
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ravi-os/sdk",
3
- "version": "0.260519.1",
3
+ "version": "0.260519.2",
4
4
  "description": "Type-safe TypeScript SDK for the Ravi gateway, generated from the live registry.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",