@granular-software/sdk 0.4.24 → 0.4.26
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 +1 -1
- package/dist/agent-evals.d.ts +1 -1
- package/dist/agent-evals.js +161 -38
- package/dist/agent-evals.js.map +1 -1
- package/dist/agent-evals.mjs +161 -38
- package/dist/agent-evals.mjs.map +1 -1
- package/dist/agent-harness.d.mts +1 -1
- package/dist/agent-harness.d.ts +1 -1
- package/dist/agent-harness.js +22 -11
- package/dist/agent-harness.js.map +1 -1
- package/dist/agent-harness.mjs +22 -11
- package/dist/agent-harness.mjs.map +1 -1
- package/dist/cli/index.js +97 -8
- package/dist/{client-CQFKsCTd.d.mts → client-Zoo8YITZ.d.mts} +39 -1
- package/dist/{client-CQFKsCTd.d.ts → client-Zoo8YITZ.d.ts} +39 -1
- package/dist/index.d.mts +11 -4
- package/dist/index.d.ts +11 -4
- package/dist/index.js +462 -38
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +462 -39
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -18160,6 +18160,7 @@ var Session = class {
|
|
|
18160
18160
|
client;
|
|
18161
18161
|
clientId;
|
|
18162
18162
|
jobsMap = /* @__PURE__ */ new Map();
|
|
18163
|
+
pendingAgentMessagesByJobId = /* @__PURE__ */ new Map();
|
|
18163
18164
|
eventListeners = /* @__PURE__ */ new Map();
|
|
18164
18165
|
toolHandlers = /* @__PURE__ */ new Map();
|
|
18165
18166
|
/** Tracks which tools are instance methods (className set, not static) */
|
|
@@ -18202,6 +18203,22 @@ var Session = class {
|
|
|
18202
18203
|
}
|
|
18203
18204
|
};
|
|
18204
18205
|
}
|
|
18206
|
+
stringifyConversationValue(value) {
|
|
18207
|
+
if (typeof value === "string") {
|
|
18208
|
+
return value;
|
|
18209
|
+
}
|
|
18210
|
+
if (typeof value === "boolean") {
|
|
18211
|
+
return value ? "Confirmed" : "Canceled";
|
|
18212
|
+
}
|
|
18213
|
+
if (value === void 0) {
|
|
18214
|
+
return "";
|
|
18215
|
+
}
|
|
18216
|
+
try {
|
|
18217
|
+
return JSON.stringify(value, null, 2);
|
|
18218
|
+
} catch {
|
|
18219
|
+
return String(value);
|
|
18220
|
+
}
|
|
18221
|
+
}
|
|
18205
18222
|
// --- Public API ---
|
|
18206
18223
|
get document() {
|
|
18207
18224
|
return this.client.doc;
|
|
@@ -18317,6 +18334,15 @@ var Session = class {
|
|
|
18317
18334
|
createdAt: Date.now()
|
|
18318
18335
|
});
|
|
18319
18336
|
this.jobsMap.set(result.jobId, job2);
|
|
18337
|
+
const pendingAgentMessages = this.pendingAgentMessagesByJobId.get(
|
|
18338
|
+
result.jobId
|
|
18339
|
+
);
|
|
18340
|
+
if (pendingAgentMessages && pendingAgentMessages.length > 0) {
|
|
18341
|
+
this.pendingAgentMessagesByJobId.delete(result.jobId);
|
|
18342
|
+
for (const message of pendingAgentMessages) {
|
|
18343
|
+
job2.replayAgentMessage(message);
|
|
18344
|
+
}
|
|
18345
|
+
}
|
|
18320
18346
|
return job2;
|
|
18321
18347
|
}
|
|
18322
18348
|
/**
|
|
@@ -18343,6 +18369,20 @@ var Session = class {
|
|
|
18343
18369
|
answer: resolvedAnswer,
|
|
18344
18370
|
value: resolvedAnswer
|
|
18345
18371
|
});
|
|
18372
|
+
try {
|
|
18373
|
+
const content = this.stringifyConversationValue(resolvedAnswer);
|
|
18374
|
+
if (content.trim()) {
|
|
18375
|
+
await this.appendConversationMessage({
|
|
18376
|
+
role: "user",
|
|
18377
|
+
content,
|
|
18378
|
+
promptId
|
|
18379
|
+
});
|
|
18380
|
+
}
|
|
18381
|
+
} catch {
|
|
18382
|
+
}
|
|
18383
|
+
}
|
|
18384
|
+
async appendConversationMessage(input) {
|
|
18385
|
+
return this.client.call("conversation.append", input);
|
|
18346
18386
|
}
|
|
18347
18387
|
/**
|
|
18348
18388
|
* Get the current list of available effects.
|
|
@@ -18718,6 +18758,22 @@ import { ${allImports} } from "./sandbox-tools";
|
|
|
18718
18758
|
this.client.on("job.status", (data) => {
|
|
18719
18759
|
this.emit("job:status", data);
|
|
18720
18760
|
});
|
|
18761
|
+
this.client.on("job.agent_message", (data) => {
|
|
18762
|
+
const normalized = normalizeJobAgentMessageEnvelope(data);
|
|
18763
|
+
if (!normalized) return;
|
|
18764
|
+
if (this.jobsMap.has(normalized.jobId)) return;
|
|
18765
|
+
const pending = this.pendingAgentMessagesByJobId.get(normalized.jobId) || [];
|
|
18766
|
+
if (normalized.message.messageId && pending.some(
|
|
18767
|
+
(message) => message.messageId === normalized.message.messageId
|
|
18768
|
+
)) {
|
|
18769
|
+
return;
|
|
18770
|
+
}
|
|
18771
|
+
pending.push(normalized.message);
|
|
18772
|
+
this.pendingAgentMessagesByJobId.set(
|
|
18773
|
+
normalized.jobId,
|
|
18774
|
+
pending.slice(-25)
|
|
18775
|
+
);
|
|
18776
|
+
});
|
|
18721
18777
|
this.client.on("exec.completed", (data) => {
|
|
18722
18778
|
this.emit("exec:completed", data);
|
|
18723
18779
|
});
|
|
@@ -18842,6 +18898,22 @@ function sanitizeFeedbackValue(value, depth = 0, seen = /* @__PURE__ */ new Weak
|
|
|
18842
18898
|
}
|
|
18843
18899
|
return truncateFeedbackString(String(value));
|
|
18844
18900
|
}
|
|
18901
|
+
function normalizeJobAgentMessageEnvelope(data) {
|
|
18902
|
+
const d = data;
|
|
18903
|
+
if (typeof d?.jobId !== "string" || !d.jobId) {
|
|
18904
|
+
return null;
|
|
18905
|
+
}
|
|
18906
|
+
return {
|
|
18907
|
+
jobId: d.jobId,
|
|
18908
|
+
message: {
|
|
18909
|
+
messageId: d.messageId,
|
|
18910
|
+
kind: d.kind === "artifacts" ? "artifacts" : "text",
|
|
18911
|
+
reply: typeof d.reply === "string" ? d.reply : "",
|
|
18912
|
+
show: d.show,
|
|
18913
|
+
timestamp: d.timestamp || Date.now()
|
|
18914
|
+
}
|
|
18915
|
+
};
|
|
18916
|
+
}
|
|
18845
18917
|
var JobImplementation = class {
|
|
18846
18918
|
id;
|
|
18847
18919
|
client;
|
|
@@ -18850,6 +18922,8 @@ var JobImplementation = class {
|
|
|
18850
18922
|
_resolveResult;
|
|
18851
18923
|
_rejectResult;
|
|
18852
18924
|
eventListeners = /* @__PURE__ */ new Map();
|
|
18925
|
+
bufferedAgentMessages = [];
|
|
18926
|
+
bufferedAgentMessageIds = /* @__PURE__ */ new Set();
|
|
18853
18927
|
metadata;
|
|
18854
18928
|
constructor(id, client, initialState) {
|
|
18855
18929
|
this.id = id;
|
|
@@ -19008,14 +19082,9 @@ var JobImplementation = class {
|
|
|
19008
19082
|
}
|
|
19009
19083
|
});
|
|
19010
19084
|
this.client.on("job.agent_message", (data) => {
|
|
19011
|
-
const
|
|
19012
|
-
if (
|
|
19013
|
-
this.
|
|
19014
|
-
messageId: d.messageId,
|
|
19015
|
-
reply: typeof d.reply === "string" ? d.reply : "",
|
|
19016
|
-
show: d.show,
|
|
19017
|
-
timestamp: d.timestamp || Date.now()
|
|
19018
|
-
});
|
|
19085
|
+
const normalized = normalizeJobAgentMessageEnvelope(data);
|
|
19086
|
+
if (normalized?.jobId === id) {
|
|
19087
|
+
this.captureAgentMessage(normalized.message);
|
|
19019
19088
|
}
|
|
19020
19089
|
});
|
|
19021
19090
|
}
|
|
@@ -19042,6 +19111,14 @@ var JobImplementation = class {
|
|
|
19042
19111
|
this.eventListeners.set(event, []);
|
|
19043
19112
|
}
|
|
19044
19113
|
this.eventListeners.get(event).push(handler);
|
|
19114
|
+
if (event === "agentMessage" && this.bufferedAgentMessages.length > 0) {
|
|
19115
|
+
for (const message of this.bufferedAgentMessages) {
|
|
19116
|
+
handler(message);
|
|
19117
|
+
}
|
|
19118
|
+
}
|
|
19119
|
+
}
|
|
19120
|
+
replayAgentMessage(message) {
|
|
19121
|
+
this.captureAgentMessage(message);
|
|
19045
19122
|
}
|
|
19046
19123
|
buildFeedbackMetadata() {
|
|
19047
19124
|
const startedAt = this.metadata.startedAt;
|
|
@@ -19111,6 +19188,18 @@ var JobImplementation = class {
|
|
|
19111
19188
|
handlers.forEach((h) => h(data));
|
|
19112
19189
|
}
|
|
19113
19190
|
}
|
|
19191
|
+
captureAgentMessage(message) {
|
|
19192
|
+
if (message.messageId && this.bufferedAgentMessageIds.has(message.messageId)) {
|
|
19193
|
+
return;
|
|
19194
|
+
}
|
|
19195
|
+
if (message.messageId) {
|
|
19196
|
+
this.bufferedAgentMessageIds.add(message.messageId);
|
|
19197
|
+
}
|
|
19198
|
+
this.bufferedAgentMessages = [...this.bufferedAgentMessages, message].slice(
|
|
19199
|
+
-25
|
|
19200
|
+
);
|
|
19201
|
+
this.emit("agentMessage", message);
|
|
19202
|
+
}
|
|
19114
19203
|
};
|
|
19115
19204
|
|
|
19116
19205
|
// src/effect-runtime.ts
|
|
@@ -670,6 +670,41 @@ interface Prompt {
|
|
|
670
670
|
allowEmpty?: boolean;
|
|
671
671
|
metadata?: Record<string, unknown>;
|
|
672
672
|
}
|
|
673
|
+
interface ConversationMessageShowRefs {
|
|
674
|
+
entryPaths?: string[];
|
|
675
|
+
listNames?: string[];
|
|
676
|
+
variableNames?: string[];
|
|
677
|
+
}
|
|
678
|
+
interface ConversationMessageInput {
|
|
679
|
+
role: 'user' | 'assistant';
|
|
680
|
+
content?: string;
|
|
681
|
+
show?: ConversationMessageShowRefs;
|
|
682
|
+
jobId?: string;
|
|
683
|
+
promptId?: string;
|
|
684
|
+
timestamp?: number;
|
|
685
|
+
}
|
|
686
|
+
interface ConversationAppendResult {
|
|
687
|
+
ok: boolean;
|
|
688
|
+
messageId: string;
|
|
689
|
+
timestamp: number;
|
|
690
|
+
jobId?: string;
|
|
691
|
+
promptId?: string;
|
|
692
|
+
}
|
|
693
|
+
interface SessionTranscriptEntry {
|
|
694
|
+
id: string;
|
|
695
|
+
role: 'user' | 'assistant';
|
|
696
|
+
content: string;
|
|
697
|
+
timestamp: number;
|
|
698
|
+
jobId?: string;
|
|
699
|
+
promptId?: string;
|
|
700
|
+
code?: string;
|
|
701
|
+
jobStatus?: string;
|
|
702
|
+
jobResultPreview?: string;
|
|
703
|
+
error?: string;
|
|
704
|
+
show?: ConversationMessageShowRefs;
|
|
705
|
+
historyContent?: string;
|
|
706
|
+
source: 'conversation' | 'job_code' | 'job_result' | 'job_prompt' | 'job_agent_message';
|
|
707
|
+
}
|
|
673
708
|
type SessionHeapFieldType = 'string' | 'number' | 'boolean' | 'null' | 'unknown';
|
|
674
709
|
interface SessionHeapFieldValue {
|
|
675
710
|
name: string;
|
|
@@ -1254,6 +1289,7 @@ declare class Session {
|
|
|
1254
1289
|
protected client: WSClient;
|
|
1255
1290
|
private clientId;
|
|
1256
1291
|
private jobsMap;
|
|
1292
|
+
private pendingAgentMessagesByJobId;
|
|
1257
1293
|
private eventListeners;
|
|
1258
1294
|
private toolHandlers;
|
|
1259
1295
|
/** Tracks which tools are instance methods (className set, not static) */
|
|
@@ -1268,6 +1304,7 @@ declare class Session {
|
|
|
1268
1304
|
constructor(client: WSClient, clientId?: string);
|
|
1269
1305
|
private extractDomainRevisionFromDoc;
|
|
1270
1306
|
private buildLegacyEffectContext;
|
|
1307
|
+
private stringifyConversationValue;
|
|
1271
1308
|
get document(): Doc<Record<string, unknown>>;
|
|
1272
1309
|
get sessionId(): string;
|
|
1273
1310
|
get domainRevision(): string | null;
|
|
@@ -1339,6 +1376,7 @@ declare class Session {
|
|
|
1339
1376
|
* Respond to a prompt request from the sandbox
|
|
1340
1377
|
*/
|
|
1341
1378
|
answerPrompt(promptId: string, answer: unknown): Promise<void>;
|
|
1379
|
+
appendConversationMessage(input: ConversationMessageInput): Promise<ConversationAppendResult>;
|
|
1342
1380
|
/**
|
|
1343
1381
|
* Get the current list of available effects.
|
|
1344
1382
|
* Consolidates effect declarations and live availability for the session.
|
|
@@ -2053,4 +2091,4 @@ declare class Granular {
|
|
|
2053
2091
|
private request;
|
|
2054
2092
|
}
|
|
2055
2093
|
|
|
2056
|
-
export { type
|
|
2094
|
+
export { type ResolvedEffectApprovalRequired as $, type AccessTokenProvider as A, type BuildPolicy as B, type ConnectOptions as C, type DomainState as D, type EndpointMode as E, type EnvironmentListResponse as F, Granular as G, type Manifest as H, type InstanceToolHandler as I, type ManifestListResponse as J, type BuildStatus as K, type Build as L, type ManifestEffectMetamodelSpec as M, type Version as N, type BuildListResponse as O, type Prompt as P, type SemanticVersionDiffEntry as Q, type ResolvedEffectBehaviors as R, type SessionHeapEntry as S, type ToolWithHandler as T, type User as U, type VersionTracking as V, WSClient as W, type SemanticVersionDiff as X, type ResolvedEffectPostCondition as Y, type ResolvedEffectDryRun as Z, type ResolvedEffectReverse as _, type EffectHandlerContext as a, type ManifestEventStreamDef as a$, type EffectInvocationMode as a0, type EffectInvocationMetadata as a1, type EffectSchema as a2, type EffectWithHandler as a3, type PublishEffectsResult as a4, type ToolInfo as a5, type EffectInfo as a6, type ToolsChangedEvent as a7, type EffectsChangedEvent as a8, type EffectHandler as a9, type DefineRelationshipOptions as aA, type RecordObjectOptions as aB, type RecordObjectResult as aC, type RecordObjectsChunkInfo as aD, type RecordObjectsOptions as aE, type RecordImportStatus as aF, type RecordImportItemStatus as aG, type RecordImportStats as aH, type RecordImportItem as aI, type RecordImport as aJ, type EnvironmentRecordImportSummary as aK, type ManifestPropertySpec as aL, type ManifestValidationOperator as aM, type ManifestEnumRuleSpec as aN, type ManifestFilterBySpec as aO, type ManifestValidationRuleSpec as aP, type ManifestStateMachineStateSpec as aQ, type ManifestStateMachineTransitionSpec as aR, type ManifestStateMachineSpec as aS, type ManifestPostConditionSpec as aT, type ManifestDryRunSpec as aU, type ManifestReverseSpec as aV, type ManifestApprovalRequiredSpec as aW, type ManifestRelationshipDef as aX, type ManifestEffectSchema as aY, type ManifestEffectDeclaration as aZ, type ManifestEventTypeDef as a_, type InstanceEffectHandler as aa, type JobStatus as ab, type JobFeedbackSentiment as ac, type JobFeedbackToolCall as ad, type JobFeedbackMetadata as ae, type JobFeedbackInput as af, type JobFeedbackRecord as ag, type JobSubmitResult as ah, type Job as ai, type ConversationMessageShowRefs as aj, type ConversationMessageInput as ak, type ConversationAppendResult as al, type SessionHeapFieldType as am, type SessionHeapFieldValue as an, type SessionHeapVariable as ao, type WSDisconnectInfo as ap, type WSReconnectErrorInfo as aq, type WSClientOptions as ar, type RPCRequest as as, type RPCResponse as at, type SyncMessage as au, type RPCRequestFromServer as av, type ToolInvokeParams as aw, type ToolResultParams as ax, type ModelRef as ay, type RelationshipInfo as az, type SessionHeapList as b, type ManifestOperation as b0, type ManifestImport as b1, type ManifestVolume as b2, type ManifestContent as b3, type GraphQLResult as b4, type APIError as b5, type DeleteResponse as b6, type StreamEvent as b7, type StreamSubscription as b8, type StreamStats as b9, type SessionHeapSnapshot as c, type SessionTranscriptEntry as d, Environment as e, Session as f, type ToolSchema as g, type PublishToolsResult as h, type ToolHandler as i, type GranularOptions as j, type GranularAuth as k, type RecordUserOptions as l, type Subject as m, type ConversationSessionInfo as n, type Sandbox as o, type CreateSandboxData as p, type SandboxListResponse as q, type PermissionRules as r, type PermissionProfile as s, type CreatePermissionProfileData as t, type PermissionProfileListResponse as u, type Assignment as v, type AssignmentListResponse as w, type VersionTag as x, type EnvironmentData as y, type CreateEnvironmentData as z };
|
|
@@ -670,6 +670,41 @@ interface Prompt {
|
|
|
670
670
|
allowEmpty?: boolean;
|
|
671
671
|
metadata?: Record<string, unknown>;
|
|
672
672
|
}
|
|
673
|
+
interface ConversationMessageShowRefs {
|
|
674
|
+
entryPaths?: string[];
|
|
675
|
+
listNames?: string[];
|
|
676
|
+
variableNames?: string[];
|
|
677
|
+
}
|
|
678
|
+
interface ConversationMessageInput {
|
|
679
|
+
role: 'user' | 'assistant';
|
|
680
|
+
content?: string;
|
|
681
|
+
show?: ConversationMessageShowRefs;
|
|
682
|
+
jobId?: string;
|
|
683
|
+
promptId?: string;
|
|
684
|
+
timestamp?: number;
|
|
685
|
+
}
|
|
686
|
+
interface ConversationAppendResult {
|
|
687
|
+
ok: boolean;
|
|
688
|
+
messageId: string;
|
|
689
|
+
timestamp: number;
|
|
690
|
+
jobId?: string;
|
|
691
|
+
promptId?: string;
|
|
692
|
+
}
|
|
693
|
+
interface SessionTranscriptEntry {
|
|
694
|
+
id: string;
|
|
695
|
+
role: 'user' | 'assistant';
|
|
696
|
+
content: string;
|
|
697
|
+
timestamp: number;
|
|
698
|
+
jobId?: string;
|
|
699
|
+
promptId?: string;
|
|
700
|
+
code?: string;
|
|
701
|
+
jobStatus?: string;
|
|
702
|
+
jobResultPreview?: string;
|
|
703
|
+
error?: string;
|
|
704
|
+
show?: ConversationMessageShowRefs;
|
|
705
|
+
historyContent?: string;
|
|
706
|
+
source: 'conversation' | 'job_code' | 'job_result' | 'job_prompt' | 'job_agent_message';
|
|
707
|
+
}
|
|
673
708
|
type SessionHeapFieldType = 'string' | 'number' | 'boolean' | 'null' | 'unknown';
|
|
674
709
|
interface SessionHeapFieldValue {
|
|
675
710
|
name: string;
|
|
@@ -1254,6 +1289,7 @@ declare class Session {
|
|
|
1254
1289
|
protected client: WSClient;
|
|
1255
1290
|
private clientId;
|
|
1256
1291
|
private jobsMap;
|
|
1292
|
+
private pendingAgentMessagesByJobId;
|
|
1257
1293
|
private eventListeners;
|
|
1258
1294
|
private toolHandlers;
|
|
1259
1295
|
/** Tracks which tools are instance methods (className set, not static) */
|
|
@@ -1268,6 +1304,7 @@ declare class Session {
|
|
|
1268
1304
|
constructor(client: WSClient, clientId?: string);
|
|
1269
1305
|
private extractDomainRevisionFromDoc;
|
|
1270
1306
|
private buildLegacyEffectContext;
|
|
1307
|
+
private stringifyConversationValue;
|
|
1271
1308
|
get document(): Doc<Record<string, unknown>>;
|
|
1272
1309
|
get sessionId(): string;
|
|
1273
1310
|
get domainRevision(): string | null;
|
|
@@ -1339,6 +1376,7 @@ declare class Session {
|
|
|
1339
1376
|
* Respond to a prompt request from the sandbox
|
|
1340
1377
|
*/
|
|
1341
1378
|
answerPrompt(promptId: string, answer: unknown): Promise<void>;
|
|
1379
|
+
appendConversationMessage(input: ConversationMessageInput): Promise<ConversationAppendResult>;
|
|
1342
1380
|
/**
|
|
1343
1381
|
* Get the current list of available effects.
|
|
1344
1382
|
* Consolidates effect declarations and live availability for the session.
|
|
@@ -2053,4 +2091,4 @@ declare class Granular {
|
|
|
2053
2091
|
private request;
|
|
2054
2092
|
}
|
|
2055
2093
|
|
|
2056
|
-
export { type
|
|
2094
|
+
export { type ResolvedEffectApprovalRequired as $, type AccessTokenProvider as A, type BuildPolicy as B, type ConnectOptions as C, type DomainState as D, type EndpointMode as E, type EnvironmentListResponse as F, Granular as G, type Manifest as H, type InstanceToolHandler as I, type ManifestListResponse as J, type BuildStatus as K, type Build as L, type ManifestEffectMetamodelSpec as M, type Version as N, type BuildListResponse as O, type Prompt as P, type SemanticVersionDiffEntry as Q, type ResolvedEffectBehaviors as R, type SessionHeapEntry as S, type ToolWithHandler as T, type User as U, type VersionTracking as V, WSClient as W, type SemanticVersionDiff as X, type ResolvedEffectPostCondition as Y, type ResolvedEffectDryRun as Z, type ResolvedEffectReverse as _, type EffectHandlerContext as a, type ManifestEventStreamDef as a$, type EffectInvocationMode as a0, type EffectInvocationMetadata as a1, type EffectSchema as a2, type EffectWithHandler as a3, type PublishEffectsResult as a4, type ToolInfo as a5, type EffectInfo as a6, type ToolsChangedEvent as a7, type EffectsChangedEvent as a8, type EffectHandler as a9, type DefineRelationshipOptions as aA, type RecordObjectOptions as aB, type RecordObjectResult as aC, type RecordObjectsChunkInfo as aD, type RecordObjectsOptions as aE, type RecordImportStatus as aF, type RecordImportItemStatus as aG, type RecordImportStats as aH, type RecordImportItem as aI, type RecordImport as aJ, type EnvironmentRecordImportSummary as aK, type ManifestPropertySpec as aL, type ManifestValidationOperator as aM, type ManifestEnumRuleSpec as aN, type ManifestFilterBySpec as aO, type ManifestValidationRuleSpec as aP, type ManifestStateMachineStateSpec as aQ, type ManifestStateMachineTransitionSpec as aR, type ManifestStateMachineSpec as aS, type ManifestPostConditionSpec as aT, type ManifestDryRunSpec as aU, type ManifestReverseSpec as aV, type ManifestApprovalRequiredSpec as aW, type ManifestRelationshipDef as aX, type ManifestEffectSchema as aY, type ManifestEffectDeclaration as aZ, type ManifestEventTypeDef as a_, type InstanceEffectHandler as aa, type JobStatus as ab, type JobFeedbackSentiment as ac, type JobFeedbackToolCall as ad, type JobFeedbackMetadata as ae, type JobFeedbackInput as af, type JobFeedbackRecord as ag, type JobSubmitResult as ah, type Job as ai, type ConversationMessageShowRefs as aj, type ConversationMessageInput as ak, type ConversationAppendResult as al, type SessionHeapFieldType as am, type SessionHeapFieldValue as an, type SessionHeapVariable as ao, type WSDisconnectInfo as ap, type WSReconnectErrorInfo as aq, type WSClientOptions as ar, type RPCRequest as as, type RPCResponse as at, type SyncMessage as au, type RPCRequestFromServer as av, type ToolInvokeParams as aw, type ToolResultParams as ax, type ModelRef as ay, type RelationshipInfo as az, type SessionHeapList as b, type ManifestOperation as b0, type ManifestImport as b1, type ManifestVolume as b2, type ManifestContent as b3, type GraphQLResult as b4, type APIError as b5, type DeleteResponse as b6, type StreamEvent as b7, type StreamSubscription as b8, type StreamStats as b9, type SessionHeapSnapshot as c, type SessionTranscriptEntry as d, Environment as e, Session as f, type ToolSchema as g, type PublishToolsResult as h, type ToolHandler as i, type GranularOptions as j, type GranularAuth as k, type RecordUserOptions as l, type Subject as m, type ConversationSessionInfo as n, type Sandbox as o, type CreateSandboxData as p, type SandboxListResponse as q, type PermissionRules as r, type PermissionProfile as s, type CreatePermissionProfileData as t, type PermissionProfileListResponse as u, type Assignment as v, type AssignmentListResponse as w, type VersionTag as x, type EnvironmentData as y, type CreateEnvironmentData as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as EndpointMode, T as ToolWithHandler, a as EffectHandlerContext, M as ManifestEffectMetamodelSpec, R as ResolvedEffectBehaviors, S as SessionHeapEntry, b as SessionHeapList, c as SessionHeapSnapshot, P as Prompt } from './client-
|
|
2
|
-
export {
|
|
1
|
+
import { E as EndpointMode, T as ToolWithHandler, a as EffectHandlerContext, M as ManifestEffectMetamodelSpec, R as ResolvedEffectBehaviors, S as SessionHeapEntry, b as SessionHeapList, c as SessionHeapSnapshot, P as Prompt, d as SessionTranscriptEntry } from './client-Zoo8YITZ.mjs';
|
|
2
|
+
export { b5 as APIError, A as AccessTokenProvider, v as Assignment, w as AssignmentListResponse, L as Build, O as BuildListResponse, B as BuildPolicy, K as BuildStatus, C as ConnectOptions, al as ConversationAppendResult, ak as ConversationMessageInput, aj as ConversationMessageShowRefs, n as ConversationSessionInfo, z as CreateEnvironmentData, t as CreatePermissionProfileData, p as CreateSandboxData, aA as DefineRelationshipOptions, b6 as DeleteResponse, D as DomainState, a9 as EffectHandler, a6 as EffectInfo, a1 as EffectInvocationMetadata, a0 as EffectInvocationMode, a2 as EffectSchema, a3 as EffectWithHandler, a8 as EffectsChangedEvent, e as Environment, y as EnvironmentData, F as EnvironmentListResponse, aK as EnvironmentRecordImportSummary, G as Granular, k as GranularAuth, j as GranularOptions, b4 as GraphQLResult, aa as InstanceEffectHandler, I as InstanceToolHandler, ai as Job, af as JobFeedbackInput, ae as JobFeedbackMetadata, ag as JobFeedbackRecord, ac as JobFeedbackSentiment, ad as JobFeedbackToolCall, ab as JobStatus, ah as JobSubmitResult, H as Manifest, aW as ManifestApprovalRequiredSpec, b3 as ManifestContent, aU as ManifestDryRunSpec, aZ as ManifestEffectDeclaration, aY as ManifestEffectSchema, aN as ManifestEnumRuleSpec, a$ as ManifestEventStreamDef, a_ as ManifestEventTypeDef, aO as ManifestFilterBySpec, b1 as ManifestImport, J as ManifestListResponse, b0 as ManifestOperation, aT as ManifestPostConditionSpec, aL as ManifestPropertySpec, aX as ManifestRelationshipDef, aV as ManifestReverseSpec, aS as ManifestStateMachineSpec, aQ as ManifestStateMachineStateSpec, aR as ManifestStateMachineTransitionSpec, aM as ManifestValidationOperator, aP as ManifestValidationRuleSpec, b2 as ManifestVolume, ay as ModelRef, s as PermissionProfile, u as PermissionProfileListResponse, r as PermissionRules, a4 as PublishEffectsResult, h as PublishToolsResult, as as RPCRequest, av as RPCRequestFromServer, at as RPCResponse, aJ as RecordImport, aI as RecordImportItem, aG as RecordImportItemStatus, aH as RecordImportStats, aF as RecordImportStatus, aB as RecordObjectOptions, aC as RecordObjectResult, aD as RecordObjectsChunkInfo, aE as RecordObjectsOptions, l as RecordUserOptions, az as RelationshipInfo, $ as ResolvedEffectApprovalRequired, Z as ResolvedEffectDryRun, Y as ResolvedEffectPostCondition, _ as ResolvedEffectReverse, o as Sandbox, q as SandboxListResponse, X as SemanticVersionDiff, Q as SemanticVersionDiffEntry, f as Session, am as SessionHeapFieldType, an as SessionHeapFieldValue, ao as SessionHeapVariable, b7 as StreamEvent, b9 as StreamStats, b8 as StreamSubscription, m as Subject, au as SyncMessage, i as ToolHandler, a5 as ToolInfo, aw as ToolInvokeParams, ax as ToolResultParams, g as ToolSchema, a7 as ToolsChangedEvent, U as User, N as Version, x as VersionTag, V as VersionTracking, W as WSClient, ar as WSClientOptions, ap as WSDisconnectInfo, aq as WSReconnectErrorInfo } from './client-Zoo8YITZ.mjs';
|
|
3
3
|
export { BuildGranularAgentSystemPromptInput, GeneratedJobCodeIssue, GranularAgentExecutionCheckpoint, GranularAgentHeapSummaryOptions, GranularAgentSessionContext, GranularAgentToolInfo, GranularAgentWorkflowFocus, HarnessContinuationDecision, HarnessControllerBudgets, HarnessProjectionOptions, HarnessPromptLike, HarnessVerifierSnapshot, HarnessVerifierSnapshotInput, buildContinuationInstruction, buildGranularAgentCheckpointBlock, buildGranularAgentDomainBlock, buildGranularAgentHeapBlock, buildGranularAgentLoopBlock, buildGranularAgentSessionBlock, buildGranularAgentSystemPrompt, buildGranularAgentToolBlock, buildGranularAgentWorkflowBlock, createHarnessVerifierSnapshot, evaluateContinuation, getCurrentClosureId, getExclusivePromptTarget, hasOpenPrompt, projectHeapSummary, projectLoopSummary, projectWorkflowFocus, projectWorkflowSummary, reviewGeneratedJobCode } from './agent-harness.mjs';
|
|
4
4
|
import '@automerge/automerge';
|
|
5
5
|
import '@automerge/automerge/slim';
|
|
@@ -34,12 +34,14 @@ interface JobPresentation {
|
|
|
34
34
|
lists: SessionHeapList[];
|
|
35
35
|
changedEntries: SessionHeapEntry[];
|
|
36
36
|
changedLists: SessionHeapList[];
|
|
37
|
+
hasExplicitArtifacts: boolean;
|
|
37
38
|
}
|
|
38
|
-
declare function resolveJobPresentation({ jobId, result, stdout, sessionHeap, }: {
|
|
39
|
+
declare function resolveJobPresentation({ jobId, result, stdout, sessionHeap, allowExplicitArtifacts, }: {
|
|
39
40
|
jobId: string;
|
|
40
41
|
result: unknown;
|
|
41
42
|
stdout?: string[];
|
|
42
43
|
sessionHeap: SessionHeapSnapshot;
|
|
44
|
+
allowExplicitArtifacts?: boolean;
|
|
43
45
|
}): JobPresentation;
|
|
44
46
|
|
|
45
47
|
declare function normalizePromptText(value: string): string;
|
|
@@ -56,4 +58,9 @@ declare function normalizePromptType(raw: Record<string, unknown> | null | undef
|
|
|
56
58
|
declare function normalizePrompt(rawValue: unknown): Prompt | null;
|
|
57
59
|
declare function resolvePromptAnswer(prompt: Prompt | undefined, answer: unknown): unknown;
|
|
58
60
|
|
|
59
|
-
|
|
61
|
+
declare function buildSessionTranscript(input: {
|
|
62
|
+
liveDoc?: Record<string, unknown> | null;
|
|
63
|
+
sessionHeap?: SessionHeapSnapshot;
|
|
64
|
+
}): SessionTranscriptEntry[];
|
|
65
|
+
|
|
66
|
+
export { EffectHandlerContext, EndpointMode, type JobPresentation, ManifestEffectMetamodelSpec, Prompt, ResolvedEffectBehaviors, SessionHeapEntry, SessionHeapList, SessionHeapSnapshot, SessionTranscriptEntry, ToolWithHandler, buildSessionTranscript, extractPromptTokens, invokeRegisteredEffect, isLocalApiUrl, normalizeEffectBehaviors, normalizePrompt, normalizePromptText, normalizePromptType, resolveApiUrl, resolveAuthTokenForApiUrl, resolveJobPresentation, resolvePromptAnswer, scorePromptChoiceMatch };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as EndpointMode, T as ToolWithHandler, a as EffectHandlerContext, M as ManifestEffectMetamodelSpec, R as ResolvedEffectBehaviors, S as SessionHeapEntry, b as SessionHeapList, c as SessionHeapSnapshot, P as Prompt } from './client-
|
|
2
|
-
export {
|
|
1
|
+
import { E as EndpointMode, T as ToolWithHandler, a as EffectHandlerContext, M as ManifestEffectMetamodelSpec, R as ResolvedEffectBehaviors, S as SessionHeapEntry, b as SessionHeapList, c as SessionHeapSnapshot, P as Prompt, d as SessionTranscriptEntry } from './client-Zoo8YITZ.js';
|
|
2
|
+
export { b5 as APIError, A as AccessTokenProvider, v as Assignment, w as AssignmentListResponse, L as Build, O as BuildListResponse, B as BuildPolicy, K as BuildStatus, C as ConnectOptions, al as ConversationAppendResult, ak as ConversationMessageInput, aj as ConversationMessageShowRefs, n as ConversationSessionInfo, z as CreateEnvironmentData, t as CreatePermissionProfileData, p as CreateSandboxData, aA as DefineRelationshipOptions, b6 as DeleteResponse, D as DomainState, a9 as EffectHandler, a6 as EffectInfo, a1 as EffectInvocationMetadata, a0 as EffectInvocationMode, a2 as EffectSchema, a3 as EffectWithHandler, a8 as EffectsChangedEvent, e as Environment, y as EnvironmentData, F as EnvironmentListResponse, aK as EnvironmentRecordImportSummary, G as Granular, k as GranularAuth, j as GranularOptions, b4 as GraphQLResult, aa as InstanceEffectHandler, I as InstanceToolHandler, ai as Job, af as JobFeedbackInput, ae as JobFeedbackMetadata, ag as JobFeedbackRecord, ac as JobFeedbackSentiment, ad as JobFeedbackToolCall, ab as JobStatus, ah as JobSubmitResult, H as Manifest, aW as ManifestApprovalRequiredSpec, b3 as ManifestContent, aU as ManifestDryRunSpec, aZ as ManifestEffectDeclaration, aY as ManifestEffectSchema, aN as ManifestEnumRuleSpec, a$ as ManifestEventStreamDef, a_ as ManifestEventTypeDef, aO as ManifestFilterBySpec, b1 as ManifestImport, J as ManifestListResponse, b0 as ManifestOperation, aT as ManifestPostConditionSpec, aL as ManifestPropertySpec, aX as ManifestRelationshipDef, aV as ManifestReverseSpec, aS as ManifestStateMachineSpec, aQ as ManifestStateMachineStateSpec, aR as ManifestStateMachineTransitionSpec, aM as ManifestValidationOperator, aP as ManifestValidationRuleSpec, b2 as ManifestVolume, ay as ModelRef, s as PermissionProfile, u as PermissionProfileListResponse, r as PermissionRules, a4 as PublishEffectsResult, h as PublishToolsResult, as as RPCRequest, av as RPCRequestFromServer, at as RPCResponse, aJ as RecordImport, aI as RecordImportItem, aG as RecordImportItemStatus, aH as RecordImportStats, aF as RecordImportStatus, aB as RecordObjectOptions, aC as RecordObjectResult, aD as RecordObjectsChunkInfo, aE as RecordObjectsOptions, l as RecordUserOptions, az as RelationshipInfo, $ as ResolvedEffectApprovalRequired, Z as ResolvedEffectDryRun, Y as ResolvedEffectPostCondition, _ as ResolvedEffectReverse, o as Sandbox, q as SandboxListResponse, X as SemanticVersionDiff, Q as SemanticVersionDiffEntry, f as Session, am as SessionHeapFieldType, an as SessionHeapFieldValue, ao as SessionHeapVariable, b7 as StreamEvent, b9 as StreamStats, b8 as StreamSubscription, m as Subject, au as SyncMessage, i as ToolHandler, a5 as ToolInfo, aw as ToolInvokeParams, ax as ToolResultParams, g as ToolSchema, a7 as ToolsChangedEvent, U as User, N as Version, x as VersionTag, V as VersionTracking, W as WSClient, ar as WSClientOptions, ap as WSDisconnectInfo, aq as WSReconnectErrorInfo } from './client-Zoo8YITZ.js';
|
|
3
3
|
export { BuildGranularAgentSystemPromptInput, GeneratedJobCodeIssue, GranularAgentExecutionCheckpoint, GranularAgentHeapSummaryOptions, GranularAgentSessionContext, GranularAgentToolInfo, GranularAgentWorkflowFocus, HarnessContinuationDecision, HarnessControllerBudgets, HarnessProjectionOptions, HarnessPromptLike, HarnessVerifierSnapshot, HarnessVerifierSnapshotInput, buildContinuationInstruction, buildGranularAgentCheckpointBlock, buildGranularAgentDomainBlock, buildGranularAgentHeapBlock, buildGranularAgentLoopBlock, buildGranularAgentSessionBlock, buildGranularAgentSystemPrompt, buildGranularAgentToolBlock, buildGranularAgentWorkflowBlock, createHarnessVerifierSnapshot, evaluateContinuation, getCurrentClosureId, getExclusivePromptTarget, hasOpenPrompt, projectHeapSummary, projectLoopSummary, projectWorkflowFocus, projectWorkflowSummary, reviewGeneratedJobCode } from './agent-harness.js';
|
|
4
4
|
import '@automerge/automerge';
|
|
5
5
|
import '@automerge/automerge/slim';
|
|
@@ -34,12 +34,14 @@ interface JobPresentation {
|
|
|
34
34
|
lists: SessionHeapList[];
|
|
35
35
|
changedEntries: SessionHeapEntry[];
|
|
36
36
|
changedLists: SessionHeapList[];
|
|
37
|
+
hasExplicitArtifacts: boolean;
|
|
37
38
|
}
|
|
38
|
-
declare function resolveJobPresentation({ jobId, result, stdout, sessionHeap, }: {
|
|
39
|
+
declare function resolveJobPresentation({ jobId, result, stdout, sessionHeap, allowExplicitArtifacts, }: {
|
|
39
40
|
jobId: string;
|
|
40
41
|
result: unknown;
|
|
41
42
|
stdout?: string[];
|
|
42
43
|
sessionHeap: SessionHeapSnapshot;
|
|
44
|
+
allowExplicitArtifacts?: boolean;
|
|
43
45
|
}): JobPresentation;
|
|
44
46
|
|
|
45
47
|
declare function normalizePromptText(value: string): string;
|
|
@@ -56,4 +58,9 @@ declare function normalizePromptType(raw: Record<string, unknown> | null | undef
|
|
|
56
58
|
declare function normalizePrompt(rawValue: unknown): Prompt | null;
|
|
57
59
|
declare function resolvePromptAnswer(prompt: Prompt | undefined, answer: unknown): unknown;
|
|
58
60
|
|
|
59
|
-
|
|
61
|
+
declare function buildSessionTranscript(input: {
|
|
62
|
+
liveDoc?: Record<string, unknown> | null;
|
|
63
|
+
sessionHeap?: SessionHeapSnapshot;
|
|
64
|
+
}): SessionTranscriptEntry[];
|
|
65
|
+
|
|
66
|
+
export { EffectHandlerContext, EndpointMode, type JobPresentation, ManifestEffectMetamodelSpec, Prompt, ResolvedEffectBehaviors, SessionHeapEntry, SessionHeapList, SessionHeapSnapshot, SessionTranscriptEntry, ToolWithHandler, buildSessionTranscript, extractPromptTokens, invokeRegisteredEffect, isLocalApiUrl, normalizeEffectBehaviors, normalizePrompt, normalizePromptText, normalizePromptType, resolveApiUrl, resolveAuthTokenForApiUrl, resolveJobPresentation, resolvePromptAnswer, scorePromptChoiceMatch };
|