@granular-software/sdk 0.4.49 → 0.4.51
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 +53 -0
- package/dist/agent-evals.d.mts +2 -2
- package/dist/agent-evals.d.ts +2 -2
- package/dist/agent-evals.js +1551 -277
- package/dist/agent-evals.js.map +1 -1
- package/dist/agent-evals.mjs +1551 -277
- package/dist/agent-evals.mjs.map +1 -1
- package/dist/agent-harness.d.mts +19 -2
- package/dist/agent-harness.d.ts +19 -2
- package/dist/agent-harness.js +81 -26
- package/dist/agent-harness.js.map +1 -1
- package/dist/agent-harness.mjs +80 -27
- package/dist/agent-harness.mjs.map +1 -1
- package/dist/cli/index.js +1492 -266
- package/dist/{client-B-MPVvDr.d.mts → client-NSH-tpNU.d.ts} +88 -11
- package/dist/{client-zihxkDDs.d.ts → client-djorlOpn.d.mts} +88 -11
- package/dist/index.d.mts +104 -5
- package/dist/index.d.ts +104 -5
- package/dist/index.js +1633 -268
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1630 -269
- package/dist/index.mjs.map +1 -1
- package/dist/{spend-CStuOBXb.d.mts → spend-BA-jZwZ0.d.mts} +505 -12
- package/dist/{spend-CStuOBXb.d.ts → spend-BA-jZwZ0.d.ts} +505 -12
- package/dist/spend.d.mts +1 -1
- package/dist/spend.d.ts +1 -1
- package/dist/spend.js +6 -1
- package/dist/spend.js.map +1 -1
- package/dist/spend.mjs +6 -1
- package/dist/spend.mjs.map +1 -1
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { E as Environment, a as EnvironmentSession, G as Granular, O as OntologyHandle, S as Session, W as WSClient } from './client-
|
|
2
|
-
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 './spend-
|
|
3
|
-
export {
|
|
4
|
-
export { BuildGranularAgentSystemPromptInput, GeneratedJobCodeIssue, GranularAgentExecutionCheckpoint, GranularAgentHeapSummaryOptions, GranularAgentPromptCapabilities, GranularAgentReferentFocus, GranularAgentSessionContext, GranularAgentToolInfo, GranularAgentWorkflowFocus, GranularReasoningTraceChunkResult, GranularReasoningTraceOptions, HarnessContinuationDecision, HarnessControllerBudgets, HarnessProjectionOptions, HarnessPromptLike, HarnessRenderedContinuation, HarnessRenderedPrompt, HarnessTemplate, HarnessTemplateManifest, HarnessTemplateSelectionOptions, HarnessTemplateStatus, HarnessVerifierSnapshot, HarnessVerifierSnapshotInput, ReviewGeneratedJobCodeOptions, buildContinuationInstruction, buildContinuationInstructionFromTemplate, buildGranularAgentCheckpointBlock, buildGranularAgentDomainBlock, buildGranularAgentFileBlock, buildGranularAgentHeapBlock, buildGranularAgentLoopBlock, buildGranularAgentReferentBlock, buildGranularAgentRuntimeImportsBlock, buildGranularAgentSessionBlock, buildGranularAgentSystemPrompt, buildGranularAgentSystemPromptFromTemplate, buildGranularAgentToolBlock, buildGranularAgentWorkflowBlock, consumeGranularReasoningOnlyChunk, consumeGranularReasoningTraceChunk, createHarnessVerifierSnapshot, evaluateContinuation, getCurrentClosureId, getDefaultHarnessTemplateId, getExclusivePromptTarget, hasOpenPrompt, hashHarnessTemplateValue, listHarnessTemplates, projectConversationReferentFocus, projectConversationReferentSummary, projectHeapSummary, projectLoopSummary, projectSessionFileSummary, projectWorkflowFocus, projectWorkflowSummary, renderContinuationInstructionFromTemplate, renderGranularAgentSystemPromptFromTemplate, resolveHarnessTemplate, reviewGeneratedJobCode, stripGranularReasoningTrace, validateHarnessTemplateManifest } from './agent-harness.js';
|
|
1
|
+
export { E as Environment, a as EnvironmentSession, G as Granular, O as OntologyHandle, S as Session, W as WSClient } from './client-NSH-tpNU.js';
|
|
2
|
+
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 './spend-BA-jZwZ0.js';
|
|
3
|
+
export { cL as APIError, A as AccessTokenProvider, bf as ArtifactApprovalDecisionInput, bg as ArtifactApprovalDecisionResult, bd as ArtifactApprovalTask, be as ArtifactApprovalTaskListOptions, bc as ArtifactApprovalTaskStatus, a9 as Assignment, aa as AssignmentListResponse, ak as Build, am as BuildListResponse, ab as BuildPolicy, aj as BuildStatus, C as ConditionIR, J as ConnectOptions, aU as ConversationActionSuggestion, aY as ConversationAppendResult, aV as ConversationMessageAction, aX as ConversationMessageInput, aW as ConversationMessagePart, aO as ConversationMessageShowRefs, L as ConversationSessionInfo, V as ConversationSessionListOptions, Q as ConversationSessionListStatus, aP as ConversationTableCell, aQ as ConversationTableColumn, aT as ConversationTableProjection, aS as ConversationTableRow, aR as ConversationTableRowReference, af as CreateEnvironmentData, a7 as CreatePermissionProfileData, a3 as CreateSandboxData, K as CreateSessionOptions, bU as DefineRelationshipOptions, cM as DeleteResponse, D as DomainState, aD as EffectHandler, aA as EffectInfo, au as EffectInvocationMetadata, at as EffectInvocationMode, av as EffectSchema, ay as EffectVersionSelector, aw as EffectWithHandler, aC as EffectsChangedEvent, ae as EnvironmentData, aL as EnvironmentFeedbackRecord, cg as EnvironmentImporter, cf as EnvironmentImporterImportOptions, ag as EnvironmentListResponse, ca as EnvironmentRecordImportSummary, cd as EnvironmentSetupLifecycleStatus, ce as EnvironmentSetupSummary, cb as EnvironmentSetupTriggerReason, b_ as EnvironmentStateMachineProxy, bY as EnvironmentStateObservationInput, b$ as EnvironmentStateProxy, bX as EnvironmentStateTarget, bZ as EnvironmentStateUpdateInput, z as GranularAuth, y as GranularOptions, a0 as GranularQuotaPolicy, a1 as GranularQuotaProgress, G as GranularSpendContext, cK as GraphQLResult, aE as InstanceEffectHandler, I as InstanceToolHandler, aN as Job, aJ as JobFeedbackInput, aI as JobFeedbackMetadata, aK as JobFeedbackRecord, aG as JobFeedbackSentiment, aH as JobFeedbackToolCall, aF as JobStatus, aM as JobSubmitResult, ah as Manifest, cz as ManifestApprovalRequiredSpec, cJ as ManifestContent, cA as ManifestCreatesSpec, cx as ManifestDryRunSpec, cD as ManifestEffectDeclaration, cC as ManifestEffectSchema, cj as ManifestEnumRuleSpec, cF as ManifestEventStreamDef, cE as ManifestEventTypeDef, ck as ManifestFilterBySpec, cH as ManifestImport, ai as ManifestListResponse, cG as ManifestOperation, cw as ManifestPostConditionSpec, ch as ManifestPropertySpec, cB as ManifestRelationshipDef, cy as ManifestReverseSpec, cv as ManifestStateMachineSpec, cm as ManifestStateMachineStateSpec, cu as ManifestStateMachineTransitionSpec, co as ManifestStateTransitionActionSpec, cp as ManifestStateTransitionAssigneeSpec, ct as ManifestStateTransitionExpectedOutcomeSpec, cn as ManifestStateTransitionInputBinding, cs as ManifestStateTransitionPermissionSpec, cq as ManifestStateTransitionRelatedStateRequirementSpec, cr as ManifestStateTransitionRequirementsSpec, ci as ManifestValidationOperator, cl as ManifestValidationRuleSpec, cI as ManifestVolume, bo as ManualActionListOptions, bm as ManualActionOccurrence, bn as ManualActionRecordResult, bk as ManualActionRelatedRecord, bi as ManualActionSource, bh as ManualActionStatus, bp as ManualActionSuggestion, bq as ManualActionSuggestionOptions, bj as ManualActionTarget, bI as MarkUserEnvironmentReadOptions, x as MatchedPolicy, bS as ModelRef, N as NormalizedOpenAIUsage, i as OPENAI_MODEL_PRICING_USD_PER_MILLION, O as OpenAIModelPricing, h as OpenAITokenSpend, l as OpenAIUsageSpendEvent, H as OpenEnvironmentOptions, a6 as PermissionProfile, a8 as PermissionProfileListResponse, a5 as PermissionRules, u as PolicyOperator, v as PolicyOrigin, s as PolicyPredicateSource, w as PolicyRuleIR, q as PolicySource, ax as PublishEffectsResult, f as PublishToolsResult, $ as QuotaLineItemFilter, Y as QuotaPeriod, X as QuotaScopeType, Z as QuotaStatus, bM as RPCRequest, bP as RPCRequestFromServer, bN as RPCResponse, c9 as RecordImport, c8 as RecordImportItem, c6 as RecordImportItemStatus, c4 as RecordImportOptions, c7 as RecordImportStats, c5 as RecordImportStatus, c3 as RecordImportWriteMode, bl as RecordManualActionInput, by as RecordMentionInput, bV as RecordObjectOptions, c0 as RecordObjectResult, bW as RecordObjectStateValue, c1 as RecordObjectsChunkInfo, c2 as RecordObjectsOptions, m as RecordOpenAIUsageSpendOptions, o as RecordOpenAIUsageSpendResult, bx as RecordSearchOptions, bw as RecordSearchResult, B as RecordUserOptions, bT as RelationshipInfo, as as ResolvedEffectApprovalRequired, aq as ResolvedEffectDryRun, ap as ResolvedEffectPostCondition, ar as ResolvedEffectReverse, cc as RunEnvironmentImporterOptions, a2 as Sandbox, a4 as SandboxListResponse, ao as SemanticVersionDiff, an as SemanticVersionDiffEntry, bb as SessionArtifactApprovalOptions, b5 as SessionArtifactAutonomyPolicy, ba as SessionArtifactExecutionOptions, b9 as SessionArtifactExecutionResult, b4 as SessionArtifactKind, b7 as SessionArtifactListOptions, b6 as SessionArtifactRecord, b3 as SessionArtifactStatus, b8 as SessionArtifactValidationResult, bA as SessionCollectionListOptions, bC as SessionCollectionListResult, aZ as SessionConversationMessage, bz as SessionDocumentResult, b0 as SessionFileKind, b2 as SessionFileRecord, a$ as SessionFileSource, b1 as SessionFileStatus, br as SessionFileUploadOptions, bt as SessionHeapFieldType, bu as SessionHeapFieldValue, bv as SessionHeapVariable, bB as SessionJobListOptions, bs as SessionJobRecord, a_ as SessionTimelineEvent, W as SpendLineItemType, _ as SpendSummary, cN as StreamEvent, cP as StreamStats, cO as StreamSubscription, F as Subject, bO as SyncMessage, g as ToolHandler, az as ToolInfo, bQ as ToolInvokeParams, bR as ToolResultParams, e as ToolSchema, aB as ToolsChangedEvent, U as User, bE as UserEnvironmentMessagePreview, bD as UserEnvironmentPrompt, bF as UserEnvironmentSessionState, bG as UserEnvironmentState, bH as UserEnvironmentStateOptions, al as Version, ad as VersionTag, ac as VersionTracking, bL as WSClientOptions, bJ as WSDisconnectInfo, bK as WSReconnectErrorInfo, p as buildOpenAISpendEventId, k as calculateOpenAITokenSpend, j as getOpenAIModelPricing, n as normalizeOpenAIUsage, r as recordOpenAIUsageSpend, t as toGranularHttpBase } from './spend-BA-jZwZ0.js';
|
|
4
|
+
export { BuildGranularAgentSystemPromptInput, GeneratedJobCodeIssue, GranularAgentExecutionCheckpoint, GranularAgentHeapSummaryOptions, GranularAgentManualActionMemorySuggestion, GranularAgentPromptCapabilities, GranularAgentReferentFocus, GranularAgentSessionContext, GranularAgentToolInfo, GranularAgentWorkflowFocus, GranularReasoningTraceChunkResult, GranularReasoningTraceOptions, HarnessContinuationDecision, HarnessControllerBudgets, HarnessProjectionOptions, HarnessPromptLike, HarnessRenderedContinuation, HarnessRenderedPrompt, HarnessTemplate, HarnessTemplateManifest, HarnessTemplateSelectionOptions, HarnessTemplateStatus, HarnessVerifierSnapshot, HarnessVerifierSnapshotInput, ReviewGeneratedJobCodeOptions, buildContinuationInstruction, buildContinuationInstructionFromTemplate, buildGranularAgentCheckpointBlock, buildGranularAgentDomainBlock, buildGranularAgentFileBlock, buildGranularAgentHeapBlock, buildGranularAgentLoopBlock, buildGranularAgentManualActionBlock, buildGranularAgentManualActionMemorySummary, buildGranularAgentReferentBlock, buildGranularAgentRuntimeImportsBlock, buildGranularAgentSessionBlock, buildGranularAgentSystemPrompt, buildGranularAgentSystemPromptFromTemplate, buildGranularAgentToolBlock, buildGranularAgentWorkflowBlock, consumeGranularReasoningOnlyChunk, consumeGranularReasoningTraceChunk, createHarnessVerifierSnapshot, evaluateContinuation, getCurrentClosureId, getDefaultHarnessTemplateId, getExclusivePromptTarget, hasOpenPrompt, hashHarnessTemplateValue, listHarnessTemplates, projectConversationReferentFocus, projectConversationReferentSummary, projectHeapSummary, projectLoopSummary, projectSessionFileSummary, projectWorkflowFocus, projectWorkflowSummary, renderContinuationInstructionFromTemplate, renderGranularAgentSystemPromptFromTemplate, resolveHarnessTemplate, reviewGeneratedJobCode, stripGranularReasoningTrace, validateHarnessTemplateManifest } from './agent-harness.js';
|
|
5
5
|
import '@automerge/automerge';
|
|
6
6
|
import '@automerge/automerge/slim';
|
|
7
7
|
|
|
@@ -29,6 +29,105 @@ type EffectRuntimeRequest = {
|
|
|
29
29
|
declare function normalizeEffectBehaviors(value?: ManifestEffectMetamodelSpec | ResolvedEffectBehaviors | null): ResolvedEffectBehaviors;
|
|
30
30
|
declare function invokeRegisteredEffect(effectMap: Map<string, ToolWithHandler>, request: EffectRuntimeRequest): Promise<unknown>;
|
|
31
31
|
|
|
32
|
+
interface ValidationRuleEvaluationInput {
|
|
33
|
+
operator?: string | null;
|
|
34
|
+
stringValue?: string;
|
|
35
|
+
string_value?: string;
|
|
36
|
+
numberValue?: number;
|
|
37
|
+
number_value?: number;
|
|
38
|
+
booleanValue?: boolean;
|
|
39
|
+
boolean_value?: boolean;
|
|
40
|
+
message?: string | null;
|
|
41
|
+
}
|
|
42
|
+
interface ValidationRuleEvaluationResult {
|
|
43
|
+
passed: boolean;
|
|
44
|
+
operator: string;
|
|
45
|
+
message?: string | null;
|
|
46
|
+
}
|
|
47
|
+
declare function evaluateValidationRule(value: unknown, rule: ValidationRuleEvaluationInput): ValidationRuleEvaluationResult;
|
|
48
|
+
declare function validationRuleFailureMessage(path: string, rule: ValidationRuleEvaluationInput): string;
|
|
49
|
+
|
|
50
|
+
type PolicyOutcome = "allow" | "confirm" | "deny";
|
|
51
|
+
type PolicySource = "manifest" | "permissionProfile" | "builtin";
|
|
52
|
+
type PolicyOrigin = {
|
|
53
|
+
kind: "manifest";
|
|
54
|
+
manifestId?: string;
|
|
55
|
+
effectKey: string;
|
|
56
|
+
} | {
|
|
57
|
+
kind: "permissionProfile";
|
|
58
|
+
profileName: string;
|
|
59
|
+
permissionProfileVersionId?: string;
|
|
60
|
+
source: PolicySource;
|
|
61
|
+
};
|
|
62
|
+
interface MatchedPolicy {
|
|
63
|
+
id: string;
|
|
64
|
+
outcome: PolicyOutcome;
|
|
65
|
+
origin: PolicyOrigin;
|
|
66
|
+
reason?: string;
|
|
67
|
+
summary: string;
|
|
68
|
+
}
|
|
69
|
+
interface PolicyDecision {
|
|
70
|
+
outcome: PolicyOutcome;
|
|
71
|
+
matches: MatchedPolicy[];
|
|
72
|
+
}
|
|
73
|
+
interface PolicyEvaluationContext {
|
|
74
|
+
input?: Record<string, unknown> | null;
|
|
75
|
+
object?: Record<string, unknown> | null;
|
|
76
|
+
stateMachines?: Record<string, string | null | undefined> | null;
|
|
77
|
+
}
|
|
78
|
+
interface PermissionProfileFile {
|
|
79
|
+
schemaVersion?: number;
|
|
80
|
+
name: string;
|
|
81
|
+
label?: string;
|
|
82
|
+
description?: string;
|
|
83
|
+
extends?: string;
|
|
84
|
+
defaultsOwnerName?: string;
|
|
85
|
+
source?: PolicySource;
|
|
86
|
+
sourcePath?: string;
|
|
87
|
+
defaults?: {
|
|
88
|
+
actionPolicy?: PolicyOutcome;
|
|
89
|
+
};
|
|
90
|
+
policies?: PermissionPolicySpec[];
|
|
91
|
+
actions?: PermissionActionSpec[];
|
|
92
|
+
}
|
|
93
|
+
interface PermissionPolicySpec {
|
|
94
|
+
id?: string;
|
|
95
|
+
ownerProfileName?: string;
|
|
96
|
+
action?: string;
|
|
97
|
+
on?: string;
|
|
98
|
+
decision?: PolicyOutcome;
|
|
99
|
+
outcome?: PolicyOutcome;
|
|
100
|
+
reason?: string;
|
|
101
|
+
when?: unknown;
|
|
102
|
+
}
|
|
103
|
+
interface PermissionActionSpec {
|
|
104
|
+
id?: string;
|
|
105
|
+
ownerProfileName?: string;
|
|
106
|
+
action: string;
|
|
107
|
+
on?: string;
|
|
108
|
+
allow?: "always";
|
|
109
|
+
deny?: "always";
|
|
110
|
+
confirm?: "always";
|
|
111
|
+
reason?: string;
|
|
112
|
+
allowWhen?: ConditionalPolicySpec[];
|
|
113
|
+
confirmWhen?: ConditionalPolicySpec[];
|
|
114
|
+
denyWhen?: ConditionalPolicySpec[];
|
|
115
|
+
limits?: LimitPolicySpec[];
|
|
116
|
+
}
|
|
117
|
+
interface ConditionalPolicySpec {
|
|
118
|
+
id?: string;
|
|
119
|
+
reason?: string;
|
|
120
|
+
when: unknown;
|
|
121
|
+
}
|
|
122
|
+
interface LimitPolicySpec {
|
|
123
|
+
id?: string;
|
|
124
|
+
input: string | string[];
|
|
125
|
+
upTo?: number;
|
|
126
|
+
above?: number;
|
|
127
|
+
decision: PolicyOutcome;
|
|
128
|
+
reason?: string;
|
|
129
|
+
}
|
|
130
|
+
|
|
32
131
|
interface JobPresentation {
|
|
33
132
|
responseText: string | null;
|
|
34
133
|
entries: SessionHeapEntry[];
|
|
@@ -75,4 +174,4 @@ declare function buildSessionTranscript(input: {
|
|
|
75
174
|
sessionHeap?: SessionHeapSnapshot;
|
|
76
175
|
}): SessionTranscriptEntry[];
|
|
77
176
|
|
|
78
|
-
export { EffectHandlerContext, EndpointMode, type JobPresentation, ManifestEffectMetamodelSpec, type NormalizedPromptChoiceOption, Prompt, ResolvedEffectBehaviors, SessionHeapEntry, SessionHeapList, SessionHeapSnapshot, SessionTranscriptEntry, ToolWithHandler, buildSessionTranscript, extractPromptTokens, invokeRegisteredEffect, isLocalApiUrl, normalizeEffectBehaviors, normalizePrompt, normalizePromptChoiceOption, normalizePromptText, normalizePromptType, resolveApiUrl, resolveAuthTokenForApiUrl, resolveJobPresentation, resolvePromptAnswer, scorePromptChoiceMatch };
|
|
177
|
+
export { type ConditionalPolicySpec, EffectHandlerContext, EndpointMode, type JobPresentation, type LimitPolicySpec, ManifestEffectMetamodelSpec, type NormalizedPromptChoiceOption, type PermissionActionSpec, type PermissionPolicySpec, type PermissionProfileFile, type PolicyDecision, type PolicyEvaluationContext, type PolicyOutcome, Prompt, ResolvedEffectBehaviors, SessionHeapEntry, SessionHeapList, SessionHeapSnapshot, SessionTranscriptEntry, ToolWithHandler, type ValidationRuleEvaluationInput, type ValidationRuleEvaluationResult, buildSessionTranscript, evaluateValidationRule, extractPromptTokens, invokeRegisteredEffect, isLocalApiUrl, normalizeEffectBehaviors, normalizePrompt, normalizePromptChoiceOption, normalizePromptText, normalizePromptType, resolveApiUrl, resolveAuthTokenForApiUrl, resolveJobPresentation, resolvePromptAnswer, scorePromptChoiceMatch, validationRuleFailureMessage };
|