@granular-software/sdk 0.4.73 → 0.4.74
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/dist/agent-evals.d.mts +2 -2
- package/dist/agent-evals.d.ts +2 -2
- package/dist/agent-evals.js +11 -3
- package/dist/agent-evals.js.map +1 -1
- package/dist/agent-evals.mjs +11 -3
- package/dist/agent-evals.mjs.map +1 -1
- package/dist/cli/index.js +11 -3
- package/dist/{client-WJrPOw6N.d.ts → client-6d1OsWJf.d.mts} +4 -2
- package/dist/{client-U0rb2nG5.d.mts → client-DdEXINlv.d.ts} +4 -2
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -3
- package/dist/index.mjs.map +1 -1
- package/dist/{spend-k8V2Y1Tt.d.mts → spend-DBRQOSaj.d.mts} +2 -0
- package/dist/{spend-k8V2Y1Tt.d.ts → spend-DBRQOSaj.d.ts} +2 -0
- package/dist/spend.d.mts +1 -1
- package/dist/spend.d.ts +1 -1
- package/package.json +1 -1
package/dist/agent-evals.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as EnvironmentSession, G as Granular } from './client-
|
|
2
|
-
import { aI as GranularSpendContext, aD as OpenAITokenSpend, n as Prompt, h as RecordObjectOptions, i as ManifestContent, m as SessionHeapSnapshot, T as ToolWithHandler, b2 as ConnectOptions, bs as CreateEnvironmentData, aX as GranularOptions } from './spend-
|
|
1
|
+
import { a as EnvironmentSession, G as Granular } from './client-6d1OsWJf.mjs';
|
|
2
|
+
import { aI as GranularSpendContext, aD as OpenAITokenSpend, n as Prompt, h as RecordObjectOptions, i as ManifestContent, m as SessionHeapSnapshot, T as ToolWithHandler, b2 as ConnectOptions, bs as CreateEnvironmentData, aX as GranularOptions } from './spend-DBRQOSaj.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';
|
package/dist/agent-evals.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as EnvironmentSession, G as Granular } from './client-
|
|
2
|
-
import { aI as GranularSpendContext, aD as OpenAITokenSpend, n as Prompt, h as RecordObjectOptions, i as ManifestContent, m as SessionHeapSnapshot, T as ToolWithHandler, b2 as ConnectOptions, bs as CreateEnvironmentData, aX as GranularOptions } from './spend-
|
|
1
|
+
import { a as EnvironmentSession, G as Granular } from './client-DdEXINlv.js';
|
|
2
|
+
import { aI as GranularSpendContext, aD as OpenAITokenSpend, n as Prompt, h as RecordObjectOptions, i as ManifestContent, m as SessionHeapSnapshot, T as ToolWithHandler, b2 as ConnectOptions, bs as CreateEnvironmentData, aX as GranularOptions } from './spend-DBRQOSaj.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';
|
package/dist/agent-evals.js
CHANGED
|
@@ -16456,13 +16456,15 @@ var Environment = class _Environment {
|
|
|
16456
16456
|
_apiEndpoint;
|
|
16457
16457
|
_tokenProvider;
|
|
16458
16458
|
_beforeMutationSend;
|
|
16459
|
-
|
|
16459
|
+
_graphqlIdempotencyKey;
|
|
16460
|
+
constructor(granular, envData, apiKey, apiEndpoint, tokenProvider, beforeMutationSend, graphqlIdempotencyKey) {
|
|
16460
16461
|
this.granular = granular;
|
|
16461
16462
|
this.envData = envData;
|
|
16462
16463
|
this._apiKey = apiKey;
|
|
16463
16464
|
this._apiEndpoint = apiEndpoint;
|
|
16464
16465
|
this._tokenProvider = tokenProvider;
|
|
16465
16466
|
this._beforeMutationSend = beforeMutationSend;
|
|
16467
|
+
this._graphqlIdempotencyKey = graphqlIdempotencyKey;
|
|
16466
16468
|
}
|
|
16467
16469
|
/** The environment ID */
|
|
16468
16470
|
get environmentId() {
|
|
@@ -17005,11 +17007,13 @@ var Environment = class _Environment {
|
|
|
17005
17007
|
if (this._beforeMutationSend && isGraphQLMutationDocument(query)) {
|
|
17006
17008
|
this._beforeMutationSend?.();
|
|
17007
17009
|
}
|
|
17010
|
+
const idempotencyKey = this._graphqlIdempotencyKey?.(query, variables);
|
|
17008
17011
|
const response = await fetch(this._apiEndpoint, {
|
|
17009
17012
|
method: "POST",
|
|
17010
17013
|
headers: {
|
|
17011
17014
|
"Content-Type": "application/json",
|
|
17012
|
-
Authorization: `Bearer ${authToken}
|
|
17015
|
+
Authorization: `Bearer ${authToken}`,
|
|
17016
|
+
...idempotencyKey ? { "Idempotency-Key": idempotencyKey } : {}
|
|
17013
17017
|
},
|
|
17014
17018
|
body: JSON.stringify({
|
|
17015
17019
|
environmentId: this.environmentId,
|
|
@@ -18583,6 +18587,7 @@ var Granular = class _Granular {
|
|
|
18583
18587
|
onUnexpectedClose;
|
|
18584
18588
|
onReconnectError;
|
|
18585
18589
|
effectHostUrl;
|
|
18590
|
+
graphqlIdempotencyKey;
|
|
18586
18591
|
debugHttp = process.env.GRANULAR_DEBUG_HTTP === "1";
|
|
18587
18592
|
/** Sandbox-level effect registry: sandboxId → (effectKey@selector → ToolWithHandler) */
|
|
18588
18593
|
sandboxEffects = /* @__PURE__ */ new Map();
|
|
@@ -18612,6 +18617,7 @@ var Granular = class _Granular {
|
|
|
18612
18617
|
this.onUnexpectedClose = options.onUnexpectedClose;
|
|
18613
18618
|
this.onReconnectError = options.onReconnectError;
|
|
18614
18619
|
this.effectHostUrl = options.effectHostUrl;
|
|
18620
|
+
this.graphqlIdempotencyKey = options.graphqlIdempotencyKey;
|
|
18615
18621
|
this.httpUrl = this.apiUrl.replace(/^wss:\/\//, "https://").replace(/^ws:\/\//, "http://").replace(/\/ws$/, "");
|
|
18616
18622
|
}
|
|
18617
18623
|
/**
|
|
@@ -19627,7 +19633,9 @@ var Granular = class _Granular {
|
|
|
19627
19633
|
envData,
|
|
19628
19634
|
this.apiKey,
|
|
19629
19635
|
graphqlEndpoint,
|
|
19630
|
-
this.tokenProvider
|
|
19636
|
+
this.tokenProvider,
|
|
19637
|
+
void 0,
|
|
19638
|
+
this.graphqlIdempotencyKey
|
|
19631
19639
|
);
|
|
19632
19640
|
}
|
|
19633
19641
|
async bindWebSocketEnvironmentSession(environment, clientId, session, transportOptions = {}) {
|