@superatomai/sdk-node 0.0.80-dsp → 0.0.81-dsp
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 +942 -942
- package/dist/index.d.mts +14 -1
- package/dist/index.d.ts +14 -1
- package/dist/index.js +21 -5
- package/dist/index.mjs +21 -5
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -2217,6 +2217,11 @@ interface AnswerProviderContext {
|
|
|
2217
2217
|
context?: PromptContext;
|
|
2218
2218
|
/** Files attached to this question (R2 references). Absent when none. */
|
|
2219
2219
|
attachments?: PromptAttachment[];
|
|
2220
|
+
/**
|
|
2221
|
+
* The composition graph to answer from, from the relay-verified identity:
|
|
2222
|
+
* "draft" or a release seq. Absent means the live release.
|
|
2223
|
+
*/
|
|
2224
|
+
graphVersion?: 'draft' | number;
|
|
2220
2225
|
}
|
|
2221
2226
|
/**
|
|
2222
2227
|
* One narrator tick while an answer was being produced: what the narrator was
|
|
@@ -5137,7 +5142,14 @@ interface RequestContext {
|
|
|
5137
5142
|
policies?: SourcePolicy[];
|
|
5138
5143
|
/** Correlates the audit log with a chat turn. */
|
|
5139
5144
|
requestId?: string;
|
|
5145
|
+
/**
|
|
5146
|
+
* Which composition graph this user's questions are answered from, as the
|
|
5147
|
+
* relay stamped it: "draft" or a release seq. Absent means the live release.
|
|
5148
|
+
*/
|
|
5149
|
+
graphVersion?: GraphVersion;
|
|
5140
5150
|
}
|
|
5151
|
+
/** A composition graph version: the platform's working copy, or a published release seq. */
|
|
5152
|
+
type GraphVersion = 'draft' | number;
|
|
5141
5153
|
/** The context for the current async chain, or `undefined` if none was established. */
|
|
5142
5154
|
declare function getRequestContext(): RequestContext | undefined;
|
|
5143
5155
|
/**
|
|
@@ -5161,6 +5173,7 @@ declare function runAsUser<T>(user: {
|
|
|
5161
5173
|
projectId?: string;
|
|
5162
5174
|
requestId?: string;
|
|
5163
5175
|
policies?: SourcePolicy[];
|
|
5176
|
+
graphVersion?: GraphVersion;
|
|
5164
5177
|
}, fn: () => T): T;
|
|
5165
5178
|
/**
|
|
5166
5179
|
* Declare a unit of work as trusted, naming why.
|
|
@@ -6687,4 +6700,4 @@ declare class SuperatomSDK {
|
|
|
6687
6700
|
getConversationSimilarityThreshold(): number;
|
|
6688
6701
|
}
|
|
6689
6702
|
|
|
6690
|
-
export { ALL_COLUMN_KEYS, ANSWER_COMPONENT_NAMES, type AgentConfig, type AgentEvent, type AgentResponse, type AgentRunContext, type AgentRunHandlers, type AgentRunRecord, type AgentRunResult, type AgentTrigger, type AgentUsage, type AnalyticsEventType, type AnalyticsStatus, type AnswerProvider, type AnswerProviderContext, type ApplySummary, BM25L, type BM25LOptions, type BaseLLMConfig, type BuildTriggerInput, CATEGORY_KEYS, CONTEXT_CONFIG, type CapturedLog, CleanupService, type CodexSessionOptions, type CodingAgentCollectionConfig, type CodingAgentDefinition, type CodingAgentSession, type CodingAgentSessionOptions, type CodingAgentsConfig, type ColInfo, type ColType, type CollectionHandler, type CollectionOperation, type Component, type DBUIBlock, DEFAULT_AGENT_CONFIG, DEFAULT_FMT_CONFIG, type DashboardAgentCollectionConfig, type DatabaseType, type FindingCode, type Fmt, type FmtConfig, type GeneratedFile, type Harness, type HybridSearchOptions, INSTRUCTIONS_FILE, type IncomingMessage, type KbNodesQueryFilters, type KbNodesRequestPayload, LLM, type LLMUsageEntry, type LogLevel, MainAgent, type McpServerSpec, type Message, MissingRequestContextError, type ModelStrategy, NUMERIC_KEYS, type NarrationUpdate, type OutputContract, type OutputField, type OutputValidator, type PiSessionListener, type PiSessionState, type PiTranscriptEntry, type Principal, type PromptAttachment, type PromptContext, type RequestContext, type RerankedResult, type RowFilter, type RunAgentOptions, STORAGE_CONFIG, type ScriptComponentSpec, ScriptMatcher, type ScriptParameter, type ScriptRecipe, type ScriptRecipeMetaRow, type ScriptRecipeStore, type ScriptResult, ScriptStore, type ScriptStoreOptions, type SelectedWorkflow, type ShimDef, type ShimSummary, type ShimTarget, type SourcePolicy, type SpecToValidate, SuperatomSDK, type SuperatomSDKConfig, type T_RESPONSE, type TaskType, Thread, ThreadManager, type Tool$1 as Tool, type ToolOutputSchema, type TriggerEvent, type TriggerFireInfo, UIBlock, UILogCollector, type User, UserManager, type UsersData, type ValidationContext, type ValidationFinding, type WorkflowDescriptor, type Workspace, analyticsClient, answerCatalogForBinding, answerComponents, anthropicLLM, assertReadOnlySql, bindContext, bridgePreamble, captureContext, clearContextTokens, contextTokenCount, createCodexSession, createCodingAgentSession, dashboardConversationHistory, dataFingerprint, describeContext, describeTriggers, emitAgentEvent, extractNamedExport, formatFindingsForAgent, geminiLLM, getCodingAgent, getCodingAgentsConfig, getPiSessionState, getRequestContext, groqLLM, hybridRerank, inferColumns, isUserContext, listCodingAgents, llmUsageLogger, logger, makeFmt, mintContextToken, normalizeScriptBody, onAgentRun, onPiSessionUpdate, openaiLLM, policiesFromConfig, projectForDatasetBinding, promptLoader, queryCache, registerCodingAgentCollection, registerCodingAgents, registerDashboardAgentCollection, requireRequestContext, rerankChromaResults, rerankConversationResults, resolveContextToken, resolveScriptRecipeStore, revokeContextToken, runAsSystem, runAsUser, runCodingAgent, runScript, runWithContext, runWithMessageIdentity, startAgentTriggers, stopAgentTriggers, userPromptErrorLogger, validateComponentSpec, withCapturedContext, writeBridgeShims, writeShims };
|
|
6703
|
+
export { ALL_COLUMN_KEYS, ANSWER_COMPONENT_NAMES, type AgentConfig, type AgentEvent, type AgentResponse, type AgentRunContext, type AgentRunHandlers, type AgentRunRecord, type AgentRunResult, type AgentTrigger, type AgentUsage, type AnalyticsEventType, type AnalyticsStatus, type AnswerProvider, type AnswerProviderContext, type ApplySummary, BM25L, type BM25LOptions, type BaseLLMConfig, type BuildTriggerInput, CATEGORY_KEYS, CONTEXT_CONFIG, type CapturedLog, CleanupService, type CodexSessionOptions, type CodingAgentCollectionConfig, type CodingAgentDefinition, type CodingAgentSession, type CodingAgentSessionOptions, type CodingAgentsConfig, type ColInfo, type ColType, type CollectionHandler, type CollectionOperation, type Component, type DBUIBlock, DEFAULT_AGENT_CONFIG, DEFAULT_FMT_CONFIG, type DashboardAgentCollectionConfig, type DatabaseType, type FindingCode, type Fmt, type FmtConfig, type GeneratedFile, type GraphVersion, type Harness, type HybridSearchOptions, INSTRUCTIONS_FILE, type IncomingMessage, type KbNodesQueryFilters, type KbNodesRequestPayload, LLM, type LLMUsageEntry, type LogLevel, MainAgent, type McpServerSpec, type Message, MissingRequestContextError, type ModelStrategy, NUMERIC_KEYS, type NarrationUpdate, type OutputContract, type OutputField, type OutputValidator, type PiSessionListener, type PiSessionState, type PiTranscriptEntry, type Principal, type PromptAttachment, type PromptContext, type RequestContext, type RerankedResult, type RowFilter, type RunAgentOptions, STORAGE_CONFIG, type ScriptComponentSpec, ScriptMatcher, type ScriptParameter, type ScriptRecipe, type ScriptRecipeMetaRow, type ScriptRecipeStore, type ScriptResult, ScriptStore, type ScriptStoreOptions, type SelectedWorkflow, type ShimDef, type ShimSummary, type ShimTarget, type SourcePolicy, type SpecToValidate, SuperatomSDK, type SuperatomSDKConfig, type T_RESPONSE, type TaskType, Thread, ThreadManager, type Tool$1 as Tool, type ToolOutputSchema, type TriggerEvent, type TriggerFireInfo, UIBlock, UILogCollector, type User, UserManager, type UsersData, type ValidationContext, type ValidationFinding, type WorkflowDescriptor, type Workspace, analyticsClient, answerCatalogForBinding, answerComponents, anthropicLLM, assertReadOnlySql, bindContext, bridgePreamble, captureContext, clearContextTokens, contextTokenCount, createCodexSession, createCodingAgentSession, dashboardConversationHistory, dataFingerprint, describeContext, describeTriggers, emitAgentEvent, extractNamedExport, formatFindingsForAgent, geminiLLM, getCodingAgent, getCodingAgentsConfig, getPiSessionState, getRequestContext, groqLLM, hybridRerank, inferColumns, isUserContext, listCodingAgents, llmUsageLogger, logger, makeFmt, mintContextToken, normalizeScriptBody, onAgentRun, onPiSessionUpdate, openaiLLM, policiesFromConfig, projectForDatasetBinding, promptLoader, queryCache, registerCodingAgentCollection, registerCodingAgents, registerDashboardAgentCollection, requireRequestContext, rerankChromaResults, rerankConversationResults, resolveContextToken, resolveScriptRecipeStore, revokeContextToken, runAsSystem, runAsUser, runCodingAgent, runScript, runWithContext, runWithMessageIdentity, startAgentTriggers, stopAgentTriggers, userPromptErrorLogger, validateComponentSpec, withCapturedContext, writeBridgeShims, writeShims };
|
package/dist/index.d.ts
CHANGED
|
@@ -2217,6 +2217,11 @@ interface AnswerProviderContext {
|
|
|
2217
2217
|
context?: PromptContext;
|
|
2218
2218
|
/** Files attached to this question (R2 references). Absent when none. */
|
|
2219
2219
|
attachments?: PromptAttachment[];
|
|
2220
|
+
/**
|
|
2221
|
+
* The composition graph to answer from, from the relay-verified identity:
|
|
2222
|
+
* "draft" or a release seq. Absent means the live release.
|
|
2223
|
+
*/
|
|
2224
|
+
graphVersion?: 'draft' | number;
|
|
2220
2225
|
}
|
|
2221
2226
|
/**
|
|
2222
2227
|
* One narrator tick while an answer was being produced: what the narrator was
|
|
@@ -5137,7 +5142,14 @@ interface RequestContext {
|
|
|
5137
5142
|
policies?: SourcePolicy[];
|
|
5138
5143
|
/** Correlates the audit log with a chat turn. */
|
|
5139
5144
|
requestId?: string;
|
|
5145
|
+
/**
|
|
5146
|
+
* Which composition graph this user's questions are answered from, as the
|
|
5147
|
+
* relay stamped it: "draft" or a release seq. Absent means the live release.
|
|
5148
|
+
*/
|
|
5149
|
+
graphVersion?: GraphVersion;
|
|
5140
5150
|
}
|
|
5151
|
+
/** A composition graph version: the platform's working copy, or a published release seq. */
|
|
5152
|
+
type GraphVersion = 'draft' | number;
|
|
5141
5153
|
/** The context for the current async chain, or `undefined` if none was established. */
|
|
5142
5154
|
declare function getRequestContext(): RequestContext | undefined;
|
|
5143
5155
|
/**
|
|
@@ -5161,6 +5173,7 @@ declare function runAsUser<T>(user: {
|
|
|
5161
5173
|
projectId?: string;
|
|
5162
5174
|
requestId?: string;
|
|
5163
5175
|
policies?: SourcePolicy[];
|
|
5176
|
+
graphVersion?: GraphVersion;
|
|
5164
5177
|
}, fn: () => T): T;
|
|
5165
5178
|
/**
|
|
5166
5179
|
* Declare a unit of work as trusted, naming why.
|
|
@@ -6687,4 +6700,4 @@ declare class SuperatomSDK {
|
|
|
6687
6700
|
getConversationSimilarityThreshold(): number;
|
|
6688
6701
|
}
|
|
6689
6702
|
|
|
6690
|
-
export { ALL_COLUMN_KEYS, ANSWER_COMPONENT_NAMES, type AgentConfig, type AgentEvent, type AgentResponse, type AgentRunContext, type AgentRunHandlers, type AgentRunRecord, type AgentRunResult, type AgentTrigger, type AgentUsage, type AnalyticsEventType, type AnalyticsStatus, type AnswerProvider, type AnswerProviderContext, type ApplySummary, BM25L, type BM25LOptions, type BaseLLMConfig, type BuildTriggerInput, CATEGORY_KEYS, CONTEXT_CONFIG, type CapturedLog, CleanupService, type CodexSessionOptions, type CodingAgentCollectionConfig, type CodingAgentDefinition, type CodingAgentSession, type CodingAgentSessionOptions, type CodingAgentsConfig, type ColInfo, type ColType, type CollectionHandler, type CollectionOperation, type Component, type DBUIBlock, DEFAULT_AGENT_CONFIG, DEFAULT_FMT_CONFIG, type DashboardAgentCollectionConfig, type DatabaseType, type FindingCode, type Fmt, type FmtConfig, type GeneratedFile, type Harness, type HybridSearchOptions, INSTRUCTIONS_FILE, type IncomingMessage, type KbNodesQueryFilters, type KbNodesRequestPayload, LLM, type LLMUsageEntry, type LogLevel, MainAgent, type McpServerSpec, type Message, MissingRequestContextError, type ModelStrategy, NUMERIC_KEYS, type NarrationUpdate, type OutputContract, type OutputField, type OutputValidator, type PiSessionListener, type PiSessionState, type PiTranscriptEntry, type Principal, type PromptAttachment, type PromptContext, type RequestContext, type RerankedResult, type RowFilter, type RunAgentOptions, STORAGE_CONFIG, type ScriptComponentSpec, ScriptMatcher, type ScriptParameter, type ScriptRecipe, type ScriptRecipeMetaRow, type ScriptRecipeStore, type ScriptResult, ScriptStore, type ScriptStoreOptions, type SelectedWorkflow, type ShimDef, type ShimSummary, type ShimTarget, type SourcePolicy, type SpecToValidate, SuperatomSDK, type SuperatomSDKConfig, type T_RESPONSE, type TaskType, Thread, ThreadManager, type Tool$1 as Tool, type ToolOutputSchema, type TriggerEvent, type TriggerFireInfo, UIBlock, UILogCollector, type User, UserManager, type UsersData, type ValidationContext, type ValidationFinding, type WorkflowDescriptor, type Workspace, analyticsClient, answerCatalogForBinding, answerComponents, anthropicLLM, assertReadOnlySql, bindContext, bridgePreamble, captureContext, clearContextTokens, contextTokenCount, createCodexSession, createCodingAgentSession, dashboardConversationHistory, dataFingerprint, describeContext, describeTriggers, emitAgentEvent, extractNamedExport, formatFindingsForAgent, geminiLLM, getCodingAgent, getCodingAgentsConfig, getPiSessionState, getRequestContext, groqLLM, hybridRerank, inferColumns, isUserContext, listCodingAgents, llmUsageLogger, logger, makeFmt, mintContextToken, normalizeScriptBody, onAgentRun, onPiSessionUpdate, openaiLLM, policiesFromConfig, projectForDatasetBinding, promptLoader, queryCache, registerCodingAgentCollection, registerCodingAgents, registerDashboardAgentCollection, requireRequestContext, rerankChromaResults, rerankConversationResults, resolveContextToken, resolveScriptRecipeStore, revokeContextToken, runAsSystem, runAsUser, runCodingAgent, runScript, runWithContext, runWithMessageIdentity, startAgentTriggers, stopAgentTriggers, userPromptErrorLogger, validateComponentSpec, withCapturedContext, writeBridgeShims, writeShims };
|
|
6703
|
+
export { ALL_COLUMN_KEYS, ANSWER_COMPONENT_NAMES, type AgentConfig, type AgentEvent, type AgentResponse, type AgentRunContext, type AgentRunHandlers, type AgentRunRecord, type AgentRunResult, type AgentTrigger, type AgentUsage, type AnalyticsEventType, type AnalyticsStatus, type AnswerProvider, type AnswerProviderContext, type ApplySummary, BM25L, type BM25LOptions, type BaseLLMConfig, type BuildTriggerInput, CATEGORY_KEYS, CONTEXT_CONFIG, type CapturedLog, CleanupService, type CodexSessionOptions, type CodingAgentCollectionConfig, type CodingAgentDefinition, type CodingAgentSession, type CodingAgentSessionOptions, type CodingAgentsConfig, type ColInfo, type ColType, type CollectionHandler, type CollectionOperation, type Component, type DBUIBlock, DEFAULT_AGENT_CONFIG, DEFAULT_FMT_CONFIG, type DashboardAgentCollectionConfig, type DatabaseType, type FindingCode, type Fmt, type FmtConfig, type GeneratedFile, type GraphVersion, type Harness, type HybridSearchOptions, INSTRUCTIONS_FILE, type IncomingMessage, type KbNodesQueryFilters, type KbNodesRequestPayload, LLM, type LLMUsageEntry, type LogLevel, MainAgent, type McpServerSpec, type Message, MissingRequestContextError, type ModelStrategy, NUMERIC_KEYS, type NarrationUpdate, type OutputContract, type OutputField, type OutputValidator, type PiSessionListener, type PiSessionState, type PiTranscriptEntry, type Principal, type PromptAttachment, type PromptContext, type RequestContext, type RerankedResult, type RowFilter, type RunAgentOptions, STORAGE_CONFIG, type ScriptComponentSpec, ScriptMatcher, type ScriptParameter, type ScriptRecipe, type ScriptRecipeMetaRow, type ScriptRecipeStore, type ScriptResult, ScriptStore, type ScriptStoreOptions, type SelectedWorkflow, type ShimDef, type ShimSummary, type ShimTarget, type SourcePolicy, type SpecToValidate, SuperatomSDK, type SuperatomSDKConfig, type T_RESPONSE, type TaskType, Thread, ThreadManager, type Tool$1 as Tool, type ToolOutputSchema, type TriggerEvent, type TriggerFireInfo, UIBlock, UILogCollector, type User, UserManager, type UsersData, type ValidationContext, type ValidationFinding, type WorkflowDescriptor, type Workspace, analyticsClient, answerCatalogForBinding, answerComponents, anthropicLLM, assertReadOnlySql, bindContext, bridgePreamble, captureContext, clearContextTokens, contextTokenCount, createCodexSession, createCodingAgentSession, dashboardConversationHistory, dataFingerprint, describeContext, describeTriggers, emitAgentEvent, extractNamedExport, formatFindingsForAgent, geminiLLM, getCodingAgent, getCodingAgentsConfig, getPiSessionState, getRequestContext, groqLLM, hybridRerank, inferColumns, isUserContext, listCodingAgents, llmUsageLogger, logger, makeFmt, mintContextToken, normalizeScriptBody, onAgentRun, onPiSessionUpdate, openaiLLM, policiesFromConfig, projectForDatasetBinding, promptLoader, queryCache, registerCodingAgentCollection, registerCodingAgents, registerDashboardAgentCollection, requireRequestContext, rerankChromaResults, rerankConversationResults, resolveContextToken, resolveScriptRecipeStore, revokeContextToken, runAsSystem, runAsUser, runCodingAgent, runScript, runWithContext, runWithMessageIdentity, startAgentTriggers, stopAgentTriggers, userPromptErrorLogger, validateComponentSpec, withCapturedContext, writeBridgeShims, writeShims };
|
package/dist/index.js
CHANGED
|
@@ -421,7 +421,10 @@ var UserPromptRequestPayloadSchema = import_zod3.z.object({
|
|
|
421
421
|
var MessageAuthContextSchema = import_zod3.z.object({
|
|
422
422
|
userId: import_zod3.z.string(),
|
|
423
423
|
orgId: import_zod3.z.string().optional(),
|
|
424
|
-
role: import_zod3.z.string().optional()
|
|
424
|
+
role: import_zod3.z.string().optional(),
|
|
425
|
+
// "draft" or a release seq; checked where it is read (request-identity.ts), so
|
|
426
|
+
// an unexpected value counts as the live release instead of rejecting the message.
|
|
427
|
+
graphVersion: import_zod3.z.unknown().optional()
|
|
425
428
|
});
|
|
426
429
|
var UserPromptRequestMessageSchema = import_zod3.z.object({
|
|
427
430
|
id: import_zod3.z.string(),
|
|
@@ -1945,9 +1948,9 @@ function runWithContext(ctx, fn) {
|
|
|
1945
1948
|
return getStorage().run(ctx, fn);
|
|
1946
1949
|
}
|
|
1947
1950
|
function runAsUser(user, fn) {
|
|
1948
|
-
const { userId, orgId, role, projectId, requestId, policies } = user;
|
|
1951
|
+
const { userId, orgId, role, projectId, requestId, policies, graphVersion } = user;
|
|
1949
1952
|
return runWithContext(
|
|
1950
|
-
{ principal: { kind: "user", userId, orgId, role }, projectId, requestId, policies },
|
|
1953
|
+
{ principal: { kind: "user", userId, orgId, role }, projectId, requestId, policies, ...graphVersion !== void 0 ? { graphVersion } : {} },
|
|
1951
1954
|
fn
|
|
1952
1955
|
);
|
|
1953
1956
|
}
|
|
@@ -2625,6 +2628,10 @@ function buildDirectToolCacheKey(toolId, parameters) {
|
|
|
2625
2628
|
}
|
|
2626
2629
|
|
|
2627
2630
|
// src/handlers/request-identity.ts
|
|
2631
|
+
function graphVersionOf(v) {
|
|
2632
|
+
if (v === "draft") return "draft";
|
|
2633
|
+
return Number.isInteger(v) && v > 0 ? v : void 0;
|
|
2634
|
+
}
|
|
2628
2635
|
function policiesFromConfig(config2) {
|
|
2629
2636
|
const entries = Array.isArray(config2) ? config2 : [config2];
|
|
2630
2637
|
const out = [];
|
|
@@ -2693,7 +2700,15 @@ function runWithMessageIdentity(message, fn) {
|
|
|
2693
2700
|
}
|
|
2694
2701
|
}
|
|
2695
2702
|
return runAsUser(
|
|
2696
|
-
{
|
|
2703
|
+
{
|
|
2704
|
+
userId: verified.userId,
|
|
2705
|
+
orgId: verified.orgId,
|
|
2706
|
+
role: verified.role,
|
|
2707
|
+
requestId,
|
|
2708
|
+
policies,
|
|
2709
|
+
// Only from the verified context: an unverified message has no say in which graph answers.
|
|
2710
|
+
graphVersion: graphVersionOf(verified.graphVersion)
|
|
2711
|
+
},
|
|
2697
2712
|
fn
|
|
2698
2713
|
);
|
|
2699
2714
|
}
|
|
@@ -19820,7 +19835,8 @@ var get_user_request = async (data, components, sendMessage, anthropicApiKey, gr
|
|
|
19820
19835
|
onNarration: narrationCallback,
|
|
19821
19836
|
signal: abortController.signal,
|
|
19822
19837
|
context: promptContextFrom(payload.context),
|
|
19823
|
-
attachments
|
|
19838
|
+
attachments,
|
|
19839
|
+
graphVersion: getRequestContext()?.graphVersion
|
|
19824
19840
|
}) : await get_agent_user_response(
|
|
19825
19841
|
prompt,
|
|
19826
19842
|
components,
|
package/dist/index.mjs
CHANGED
|
@@ -310,7 +310,10 @@ var UserPromptRequestPayloadSchema = z3.object({
|
|
|
310
310
|
var MessageAuthContextSchema = z3.object({
|
|
311
311
|
userId: z3.string(),
|
|
312
312
|
orgId: z3.string().optional(),
|
|
313
|
-
role: z3.string().optional()
|
|
313
|
+
role: z3.string().optional(),
|
|
314
|
+
// "draft" or a release seq; checked where it is read (request-identity.ts), so
|
|
315
|
+
// an unexpected value counts as the live release instead of rejecting the message.
|
|
316
|
+
graphVersion: z3.unknown().optional()
|
|
314
317
|
});
|
|
315
318
|
var UserPromptRequestMessageSchema = z3.object({
|
|
316
319
|
id: z3.string(),
|
|
@@ -1834,9 +1837,9 @@ function runWithContext(ctx, fn) {
|
|
|
1834
1837
|
return getStorage().run(ctx, fn);
|
|
1835
1838
|
}
|
|
1836
1839
|
function runAsUser(user, fn) {
|
|
1837
|
-
const { userId, orgId, role, projectId, requestId, policies } = user;
|
|
1840
|
+
const { userId, orgId, role, projectId, requestId, policies, graphVersion } = user;
|
|
1838
1841
|
return runWithContext(
|
|
1839
|
-
{ principal: { kind: "user", userId, orgId, role }, projectId, requestId, policies },
|
|
1842
|
+
{ principal: { kind: "user", userId, orgId, role }, projectId, requestId, policies, ...graphVersion !== void 0 ? { graphVersion } : {} },
|
|
1840
1843
|
fn
|
|
1841
1844
|
);
|
|
1842
1845
|
}
|
|
@@ -2514,6 +2517,10 @@ function buildDirectToolCacheKey(toolId, parameters) {
|
|
|
2514
2517
|
}
|
|
2515
2518
|
|
|
2516
2519
|
// src/handlers/request-identity.ts
|
|
2520
|
+
function graphVersionOf(v) {
|
|
2521
|
+
if (v === "draft") return "draft";
|
|
2522
|
+
return Number.isInteger(v) && v > 0 ? v : void 0;
|
|
2523
|
+
}
|
|
2517
2524
|
function policiesFromConfig(config2) {
|
|
2518
2525
|
const entries = Array.isArray(config2) ? config2 : [config2];
|
|
2519
2526
|
const out = [];
|
|
@@ -2582,7 +2589,15 @@ function runWithMessageIdentity(message, fn) {
|
|
|
2582
2589
|
}
|
|
2583
2590
|
}
|
|
2584
2591
|
return runAsUser(
|
|
2585
|
-
{
|
|
2592
|
+
{
|
|
2593
|
+
userId: verified.userId,
|
|
2594
|
+
orgId: verified.orgId,
|
|
2595
|
+
role: verified.role,
|
|
2596
|
+
requestId,
|
|
2597
|
+
policies,
|
|
2598
|
+
// Only from the verified context: an unverified message has no say in which graph answers.
|
|
2599
|
+
graphVersion: graphVersionOf(verified.graphVersion)
|
|
2600
|
+
},
|
|
2586
2601
|
fn
|
|
2587
2602
|
);
|
|
2588
2603
|
}
|
|
@@ -19709,7 +19724,8 @@ var get_user_request = async (data, components, sendMessage, anthropicApiKey, gr
|
|
|
19709
19724
|
onNarration: narrationCallback,
|
|
19710
19725
|
signal: abortController.signal,
|
|
19711
19726
|
context: promptContextFrom(payload.context),
|
|
19712
|
-
attachments
|
|
19727
|
+
attachments,
|
|
19728
|
+
graphVersion: getRequestContext()?.graphVersion
|
|
19713
19729
|
}) : await get_agent_user_response(
|
|
19714
19730
|
prompt,
|
|
19715
19731
|
components,
|