export { E as Environment, a as EnvironmentSession, G as Granular, O as OntologyHandle, S as Session, W as WSClient } from './client-BZ8NuQ_e.js';
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-tAz2a16I.js';
export { bO as APIError, A as AccessTokenProvider, a0 as Assignment, a1 as AssignmentListResponse, ab as Build, ad as BuildListResponse, a2 as BuildPolicy, aa as BuildStatus, C as ConnectOptions, aH as ConversationAppendResult, aG as ConversationMessageInput, aF as ConversationMessageShowRefs, y as ConversationSessionInfo, a6 as CreateEnvironmentData, _ as CreatePermissionProfileData, W as CreateSandboxData, x as CreateSessionOptions, b9 as DefineRelationshipOptions, bP as DeleteResponse, D as DomainState, au as EffectHandler, ar as EffectInfo, al as EffectInvocationMetadata, ak as EffectInvocationMode, am as EffectSchema, ap as EffectVersionSelector, an as EffectWithHandler, at as EffectsChangedEvent, a5 as EnvironmentData, aC as EnvironmentFeedbackRecord, br as EnvironmentImporter, bq as EnvironmentImporterImportOptions, a7 as EnvironmentListResponse, bl as EnvironmentRecordImportSummary, bo as EnvironmentSetupLifecycleStatus, bp as EnvironmentSetupSummary, bm as EnvironmentSetupTriggerReason, s as GranularAuth, q as GranularOptions, K as GranularQuotaPolicy, L as GranularQuotaProgress, G as GranularSpendContext, bN as GraphQLResult, av as InstanceEffectHandler, I as InstanceToolHandler, aE as Job, aA as JobFeedbackInput, az as JobFeedbackMetadata, aB as JobFeedbackRecord, ax as JobFeedbackSentiment, ay as JobFeedbackToolCall, aw as JobStatus, aD as JobSubmitResult, a8 as Manifest, bD as ManifestApprovalRequiredSpec, bM as ManifestContent, bB as ManifestDryRunSpec, bG as ManifestEffectDeclaration, bF as ManifestEffectSchema, bu as ManifestEnumRuleSpec, bI as ManifestEventStreamDef, bH as ManifestEventTypeDef, bv as ManifestFilterBySpec, bK as ManifestImport, a9 as ManifestListResponse, bJ as ManifestOperation, bA as ManifestPostConditionSpec, bs as ManifestPropertySpec, bE as ManifestRelationshipDef, bC as ManifestReverseSpec, bz as ManifestStateMachineSpec, bx as ManifestStateMachineStateSpec, by as ManifestStateMachineTransitionSpec, bt as ManifestValidationOperator, bw as ManifestValidationRuleSpec, bL as ManifestVolume, b7 as ModelRef, N as NormalizedOpenAIUsage, i as OPENAI_MODEL_PRICING_USD_PER_MILLION, O as OpenAIModelPricing, h as OpenAITokenSpend, l as OpenAIUsageSpendEvent, w as OpenEnvironmentOptions, Z as PermissionProfile, $ as PermissionProfileListResponse, Y as PermissionRules, ao as PublishEffectsResult, f as PublishToolsResult, J as QuotaLineItemFilter, B as QuotaPeriod, Q as QuotaScopeType, F as QuotaStatus, b1 as RPCRequest, b4 as RPCRequestFromServer, b2 as RPCResponse, bk as RecordImport, bj as RecordImportItem, bh as RecordImportItemStatus, bf as RecordImportOptions, bi as RecordImportStats, bg as RecordImportStatus, be as RecordImportWriteMode, aV as RecordMentionInput, ba as RecordObjectOptions, bb as RecordObjectResult, bc as RecordObjectsChunkInfo, bd as RecordObjectsOptions, m as RecordOpenAIUsageSpendOptions, o as RecordOpenAIUsageSpendResult, aU as RecordSearchOptions, aT as RecordSearchResult, u as RecordUserOptions, b8 as RelationshipInfo, aj as ResolvedEffectApprovalRequired, ah as ResolvedEffectDryRun, ag as ResolvedEffectPostCondition, ai as ResolvedEffectReverse, bn as RunEnvironmentImporterOptions, V as Sandbox, X as SandboxListResponse, af as SemanticVersionDiff, ae as SemanticVersionDiffEntry, aX as SessionCollectionListOptions, aZ as SessionCollectionListResult, aI as SessionConversationMessage, aW as SessionDocumentResult, aL as SessionFileKind, aN as SessionFileRecord, aK as SessionFileSource, aM as SessionFileStatus, aO as SessionFileUploadOptions, aQ as SessionHeapFieldType, aR as SessionHeapFieldValue, aS as SessionHeapVariable, aY as SessionJobListOptions, aP as SessionJobRecord, aJ as SessionTimelineEvent, z as SpendLineItemType, H as SpendSummary, bQ as StreamEvent, bS as StreamStats, bR as StreamSubscription, v as Subject, b3 as SyncMessage, g as ToolHandler, aq as ToolInfo, b5 as ToolInvokeParams, b6 as ToolResultParams, e as ToolSchema, as as ToolsChangedEvent, U as User, ac as Version, a4 as VersionTag, a3 as VersionTracking, b0 as WSClientOptions, a_ as WSDisconnectInfo, a$ as WSReconnectErrorInfo, p as buildOpenAISpendEventId, k as calculateOpenAITokenSpend, j as getOpenAIModelPricing, n as normalizeOpenAIUsage, r as recordOpenAIUsageSpend, t as toGranularHttpBase } from './spend-tAz2a16I.js';
export { ConditionIR, ConditionalPolicySpec, LimitPolicySpec, MatchedPolicy, PermissionActionSpec, PermissionPolicySpec, PermissionProfileFile, PolicyDecision, PolicyEvaluationContext, PolicyOutcome, PolicyRuleIR } from '@granular-software/policy-engine';
export { BuildGranularAgentSystemPromptInput, GeneratedJobCodeIssue, GranularAgentExecutionCheckpoint, GranularAgentHeapSummaryOptions, GranularAgentPromptCapabilities, GranularAgentReferentFocus, GranularAgentSessionContext, GranularAgentToolInfo, GranularAgentWorkflowFocus, GranularReasoningTraceChunkResult, GranularReasoningTraceOptions, HarnessContinuationDecision, HarnessControllerBudgets, HarnessProjectionOptions, HarnessPromptLike, HarnessVerifierSnapshot, HarnessVerifierSnapshotInput, ReviewGeneratedJobCodeOptions, buildContinuationInstruction, buildGranularAgentCheckpointBlock, buildGranularAgentDomainBlock, buildGranularAgentFileBlock, buildGranularAgentHeapBlock, buildGranularAgentLoopBlock, buildGranularAgentReferentBlock, buildGranularAgentRuntimeImportsBlock, buildGranularAgentSessionBlock, buildGranularAgentSystemPrompt, buildGranularAgentToolBlock, buildGranularAgentWorkflowBlock, consumeGranularReasoningOnlyChunk, consumeGranularReasoningTraceChunk, createHarnessVerifierSnapshot, evaluateContinuation, getCurrentClosureId, getExclusivePromptTarget, hasOpenPrompt, projectConversationReferentFocus, projectConversationReferentSummary, projectHeapSummary, projectLoopSummary, projectSessionFileSummary, projectWorkflowFocus, projectWorkflowSummary, reviewGeneratedJobCode, stripGranularReasoningTrace } from './agent-harness.js';
import '@automerge/automerge';
import '@automerge/automerge/slim';

declare function isLocalApiUrl(url: string): boolean;
/**
 * Local dev + `sk_*` (WorkOS org key in env): map to the local gn_sk e2e key by default so every
 * request (HTTP + WebSocket) uses the same tenant as the v2 UI on localhost (`default`). Without
 * this, the SDK passes `sk_*` through → gateway resolves org_… while the UI still uses gn_sk →
 * you only see old default-tenant sandboxes and new ingest data looks “missing”.
 *
 * - `GRANULAR_LOCAL_API_KEY` — explicit key to use instead (e.g. another gn_sk).
 * - `GRANULAR_DISABLE_LOCAL_API_KEY_FALLBACK=1` — do not swap; send the real `sk_*` (org tenant +
 *   WorkOS validation on the gateway). Use when the UI is also on that org (e.g. session auth +
 *   NEXT_PUBLIC_DISABLE_LOCAL_API_KEY_FALLBACK on the app).
 */
declare function resolveAuthTokenForApiUrl(authToken: string, apiUrl: string): string;
declare function resolveApiUrl(explicitApiUrl?: string, mode?: EndpointMode): string;

type EffectRuntimeRequest = {
    effectKey: string;
    effectName: string;
    input: unknown;
    context?: EffectHandlerContext;
};
declare function normalizeEffectBehaviors(value?: ManifestEffectMetamodelSpec | ResolvedEffectBehaviors | null): ResolvedEffectBehaviors;
declare function invokeRegisteredEffect(effectMap: Map<string, ToolWithHandler>, request: EffectRuntimeRequest): Promise<unknown>;

interface JobPresentation {
    responseText: string | null;
    entries: SessionHeapEntry[];
    lists: SessionHeapList[];
    changedEntries: SessionHeapEntry[];
    changedLists: SessionHeapList[];
    hasExplicitArtifacts: boolean;
}
declare function resolveJobPresentation({ jobId, result, stdout, agentMessages, sessionHeap, allowExplicitArtifacts, }: {
    jobId: string;
    result: unknown;
    stdout?: string[];
    agentMessages?: unknown[];
    sessionHeap: SessionHeapSnapshot;
    allowExplicitArtifacts?: boolean;
}): JobPresentation;

declare function normalizePromptText(value: string): string;
declare function extractPromptTokens(value: string): string[];
interface NormalizedPromptChoiceOption {
    value: string;
    label: string;
    description?: string;
}
declare function normalizePromptChoiceOption(option: string | {
    value?: string;
    label?: string;
    description?: string;
}): NormalizedPromptChoiceOption;
declare function scorePromptChoiceMatch(answer: string, answerTokens: string[], option: string | {
    value?: string;
    label?: string;
    description?: string;
}): {
    score: number;
    resolvedValue: string | null;
};
declare function normalizePromptType(raw: Record<string, unknown> | null | undefined): Prompt["type"];
declare function normalizePrompt(rawValue: unknown): Prompt | null;
declare function resolvePromptAnswer(prompt: Prompt | undefined, answer: unknown): unknown;

declare function buildSessionTranscript(input: {
    liveDoc?: Record<string, unknown> | null;
    sessionHeap?: SessionHeapSnapshot;
}): SessionTranscriptEntry[];

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 };
