@granular-software/sdk 0.4.58 → 0.4.60
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 +38 -4
- package/dist/agent-evals.d.mts +2 -3
- package/dist/agent-evals.d.ts +2 -3
- package/dist/agent-evals.js +2910 -1329
- package/dist/agent-evals.js.map +1 -1
- package/dist/agent-evals.mjs +2910 -1329
- package/dist/agent-evals.mjs.map +1 -1
- package/dist/agent-harness.d.mts +3 -3
- package/dist/agent-harness.d.ts +3 -3
- package/dist/agent-harness.js +67 -131
- package/dist/agent-harness.js.map +1 -1
- package/dist/agent-harness.mjs +67 -131
- package/dist/agent-harness.mjs.map +1 -1
- package/dist/cli/index.js +2394 -1009
- package/dist/{client-DFaCRSto.d.mts → client-BzgQvNyG.d.ts} +90 -17
- package/dist/{client-UdGt44dF.d.ts → client-DSkGcmmX.d.mts} +90 -17
- package/dist/index.d.mts +33 -11
- package/dist/index.d.ts +33 -11
- package/dist/index.js +2840 -1252
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2826 -1253
- package/dist/index.mjs.map +1 -1
- package/dist/{spend-czRX7l0X.d.mts → spend-CNe-Ff6U.d.mts} +670 -98
- package/dist/{spend-czRX7l0X.d.ts → spend-CNe-Ff6U.d.ts} +670 -98
- package/dist/spend.d.mts +1 -1
- package/dist/spend.d.ts +1 -1
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -751,26 +751,60 @@ Session history is always bounded (100 rows by default, 500 maximum). Increment
|
|
|
751
751
|
`granular.listSessions()` also accepts `environmentId`, `sandboxId`, and
|
|
752
752
|
`subjectId`; at least one ownership filter is required.
|
|
753
753
|
|
|
754
|
+
### Canonical User And Assistant Ingress
|
|
755
|
+
|
|
756
|
+
The live session API has no mixed-role message append. Browser and server
|
|
757
|
+
callers append user input with an implicit user role:
|
|
758
|
+
|
|
759
|
+
```ts
|
|
760
|
+
await session.appendUserMessage({
|
|
761
|
+
id: "user_turn_42",
|
|
762
|
+
operationId: "send:user_turn_42",
|
|
763
|
+
content: "Compare the open requests.",
|
|
764
|
+
show: { fileIds: ["file_123"] },
|
|
765
|
+
});
|
|
766
|
+
```
|
|
767
|
+
|
|
768
|
+
Only trusted API-key `EnvironmentSession` handles can publish a terminal
|
|
769
|
+
assistant text occurrence:
|
|
770
|
+
|
|
771
|
+
```ts
|
|
772
|
+
await session.publishAssistantReply({
|
|
773
|
+
id: "assistant_turn_42",
|
|
774
|
+
operationId: "reply:assistant_turn_42",
|
|
775
|
+
text: "The comparison is ready.",
|
|
776
|
+
});
|
|
777
|
+
```
|
|
778
|
+
|
|
779
|
+
Delegated browsers cannot call `publishAssistantReply()`. Generated jobs should
|
|
780
|
+
author messages and components with the trusted Harness feed helpers.
|
|
781
|
+
|
|
754
782
|
### Live Session State And Durable Collections
|
|
755
783
|
|
|
756
784
|
`session.document` and `session.getHeap()` are local, fast views of the live runtime state synced over the WebSocket.
|
|
757
785
|
|
|
758
|
-
|
|
786
|
+
The canonical customer-visible history is the server-sequenced feed. The
|
|
787
|
+
transcript is a message-oriented projection of that same feed. Timeline events
|
|
788
|
+
and jobs are diagnostic collections; they are not presentation chronology.
|
|
789
|
+
Saved heap artifacts remain available through their named collections:
|
|
759
790
|
|
|
760
791
|
```ts
|
|
761
792
|
const session = await env.sessions.create();
|
|
762
793
|
|
|
763
794
|
const liveHeap = session.getHeap();
|
|
764
|
-
const
|
|
795
|
+
const feed = await session.feed.list({ afterSequence: 0, limit: 100 });
|
|
796
|
+
const transcript = await session.transcript.list({ limit: 100 });
|
|
765
797
|
const timeline = await session.timeline.list({ limit: 100 });
|
|
766
798
|
const jobs = await session.jobs.list({ status: "all", limit: 100 });
|
|
767
799
|
const job = await session.jobs.get("job_123");
|
|
768
800
|
const entry = await session.heap.entries.get("customer_123");
|
|
769
801
|
const savedList = await session.heap.lists.get("recent_customers");
|
|
770
|
-
const transcript = await session.transcript.list({ limit: 100 });
|
|
771
802
|
```
|
|
772
803
|
|
|
773
|
-
Use the live state for current
|
|
804
|
+
Use the live state for current resource lifecycle data, `feed.list()` for exact
|
|
805
|
+
durable presentation order, and `transcript.list()` when only message-like
|
|
806
|
+
history is needed. Page the feed by server sequence; never reconstruct display
|
|
807
|
+
order from timeline events, jobs, or timestamps.
|
|
774
808
|
|
|
775
809
|
### `session.getDomainDocumentation()`
|
|
776
810
|
|
package/dist/agent-evals.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as EnvironmentSession, G as Granular } from './client-
|
|
2
|
-
import {
|
|
1
|
+
import { a as EnvironmentSession, G as Granular } from './client-DSkGcmmX.mjs';
|
|
2
|
+
import { at as GranularSpendContext, ao as OpenAITokenSpend, P as Prompt, cX as RecordObjectOptions, dN as ManifestContent, d as SessionHeapSnapshot, T as ToolWithHandler, aP as ConnectOptions, bd as CreateEnvironmentData, aI as GranularOptions } from './spend-CNe-Ff6U.mjs';
|
|
3
3
|
import { GranularAgentToolInfo, GeneratedJobCodeIssue, BuildGranularAgentSystemPromptInput, HarnessRenderedPrompt, HarnessRenderedContinuation, HarnessControllerBudgets } from './agent-harness.mjs';
|
|
4
4
|
import '@automerge/automerge';
|
|
5
5
|
import '@automerge/automerge/slim';
|
|
@@ -369,7 +369,6 @@ interface AgentEvalPendingTurn {
|
|
|
369
369
|
turnDir: string;
|
|
370
370
|
boundaryTimestamp: number;
|
|
371
371
|
finalCode: string;
|
|
372
|
-
finalReply: string;
|
|
373
372
|
stdout: string[];
|
|
374
373
|
stderr: string[];
|
|
375
374
|
prompts: Prompt[];
|
package/dist/agent-evals.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as EnvironmentSession, G as Granular } from './client-
|
|
2
|
-
import {
|
|
1
|
+
import { a as EnvironmentSession, G as Granular } from './client-BzgQvNyG.js';
|
|
2
|
+
import { at as GranularSpendContext, ao as OpenAITokenSpend, P as Prompt, cX as RecordObjectOptions, dN as ManifestContent, d as SessionHeapSnapshot, T as ToolWithHandler, aP as ConnectOptions, bd as CreateEnvironmentData, aI as GranularOptions } from './spend-CNe-Ff6U.js';
|
|
3
3
|
import { GranularAgentToolInfo, GeneratedJobCodeIssue, BuildGranularAgentSystemPromptInput, HarnessRenderedPrompt, HarnessRenderedContinuation, HarnessControllerBudgets } from './agent-harness.js';
|
|
4
4
|
import '@automerge/automerge';
|
|
5
5
|
import '@automerge/automerge/slim';
|
|
@@ -369,7 +369,6 @@ interface AgentEvalPendingTurn {
|
|
|
369
369
|
turnDir: string;
|
|
370
370
|
boundaryTimestamp: number;
|
|
371
371
|
finalCode: string;
|
|
372
|
-
finalReply: string;
|
|
373
372
|
stdout: string[];
|
|
374
373
|
stderr: string[];
|
|
375
374
|
prompts: Prompt[];
|