@granular-software/sdk 0.4.31 → 0.4.33

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
@@ -594,6 +594,27 @@ Registers ontology-scoped live handlers for effects declared in the ontology man
594
594
 
595
595
  Open a live runtime session for the environment, then submit code to the sandbox. The code imports typed classes from `./sandbox-tools`.
596
596
 
597
+ ### Live Session State And Durable Collections
598
+
599
+ `session.document` and `session.getHeap()` are local, fast views of the live runtime state synced over the WebSocket.
600
+
601
+ Older conversation history, timeline events, completed jobs, and saved heap artifacts are exposed through named durable collections:
602
+
603
+ ```ts
604
+ const session = await env.sessions.create();
605
+
606
+ const liveHeap = session.getHeap();
607
+ const messages = await session.messages.list({ limit: 100 });
608
+ const timeline = await session.timeline.list({ limit: 100 });
609
+ const jobs = await session.jobs.list({ status: "all", limit: 100 });
610
+ const job = await session.jobs.get("job_123");
611
+ const entry = await session.heap.entries.get("customer_123");
612
+ const savedList = await session.heap.lists.get("recent_customers");
613
+ const transcript = await session.transcript.list({ limit: 100 });
614
+ ```
615
+
616
+ Use the live state for current working context, and the collection APIs when you need durable history or artifacts that may have been moved out of the live document.
617
+
597
618
  ### `session.getDomainDocumentation()`
598
619
 
599
620
  Get auto-generated TypeScript class declarations. Pass this to LLMs to help them write correct code.
@@ -1,4 +1,4 @@
1
- import { P as Prompt, f as EnvironmentSession, c as SessionHeapSnapshot, b8 as ManifestContent, aG as RecordObjectOptions, T as ToolWithHandler, G as Granular, C as ConnectOptions, J as CreateEnvironmentData, k as GranularOptions } from './client-CTH1hfwe.mjs';
1
+ import { P as Prompt, f as EnvironmentSession, c as SessionHeapSnapshot, bf as ManifestContent, aN as RecordObjectOptions, T as ToolWithHandler, G as Granular, C as ConnectOptions, J as CreateEnvironmentData, k as GranularOptions } from './client-DTvI5MUG.mjs';
2
2
  import { GeneratedJobCodeIssue, HarnessControllerBudgets } from './agent-harness.mjs';
3
3
  import '@automerge/automerge';
4
4
  import '@automerge/automerge/slim';
@@ -1,4 +1,4 @@
1
- import { P as Prompt, f as EnvironmentSession, c as SessionHeapSnapshot, b8 as ManifestContent, aG as RecordObjectOptions, T as ToolWithHandler, G as Granular, C as ConnectOptions, J as CreateEnvironmentData, k as GranularOptions } from './client-CTH1hfwe.js';
1
+ import { P as Prompt, f as EnvironmentSession, c as SessionHeapSnapshot, bf as ManifestContent, aN as RecordObjectOptions, T as ToolWithHandler, G as Granular, C as ConnectOptions, J as CreateEnvironmentData, k as GranularOptions } from './client-DTvI5MUG.js';
2
2
  import { GeneratedJobCodeIssue, HarnessControllerBudgets } from './agent-harness.js';
3
3
  import '@automerge/automerge';
4
4
  import '@automerge/automerge/slim';