@opengeni/core 2.4.0-canary.2 → 2.5.2-canary.0
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/access/index.d.ts +2 -0
- package/dist/application/composer-submit.d.ts +24 -0
- package/dist/application/session-commands.d.ts +4 -2
- package/dist/canonical-human-identities.d.ts +7 -2
- package/dist/canonical-human-identities.js +17 -4
- package/dist/canonical-human-identities.js.map +1 -1
- package/dist/chunk-YGOMUGYS.js +226 -0
- package/dist/chunk-YGOMUGYS.js.map +1 -0
- package/dist/chunk-ZVZJTMSV.js +369 -0
- package/dist/chunk-ZVZJTMSV.js.map +1 -0
- package/dist/dependencies.d.ts +3 -0
- package/dist/domain/sessions.d.ts +4 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +134 -47
- package/dist/index.js.map +1 -1
- package/dist/managed-auth-session-sets.d.ts +113 -0
- package/dist/managed-auth-session-sets.js +49 -0
- package/dist/managed-auth-session-sets.js.map +1 -0
- package/dist/managed-session.d.ts +47 -3
- package/package.json +14 -10
- package/src/access/index.ts +8 -1
- package/src/application/composer-submit.ts +76 -0
- package/src/application/session-commands.ts +80 -48
- package/src/canonical-human-identities.ts +22 -3
- package/src/dependencies.ts +3 -0
- package/src/domain/sessions.ts +22 -0
- package/src/index.ts +14 -1
- package/src/managed-auth-session-sets.ts +344 -0
- package/src/managed-session.ts +488 -1
- package/dist/chunk-IBOEYG6N.js +0 -34
- package/dist/chunk-IBOEYG6N.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -116,8 +116,17 @@ import {
|
|
|
116
116
|
validateEditableArtifactActor
|
|
117
117
|
} from "./chunk-VCZFFEPB.js";
|
|
118
118
|
import {
|
|
119
|
-
|
|
120
|
-
|
|
119
|
+
ManagedAuthActorLeaseOutcomeUnknownError,
|
|
120
|
+
getManagedAuthRequestActorAbortSignal,
|
|
121
|
+
getManagedAuthRequestActorAdmissionStamp,
|
|
122
|
+
getManagedAuthRequestActorEpoch,
|
|
123
|
+
getManagedAuthRequestActorLeaseStamp,
|
|
124
|
+
getManagedSession,
|
|
125
|
+
markManagedAuthRequestActorTransitionApplied,
|
|
126
|
+
releaseManagedAuthRequestActorLease,
|
|
127
|
+
validateManagedAuthRequestActorLease
|
|
128
|
+
} from "./chunk-ZVZJTMSV.js";
|
|
129
|
+
import "./chunk-YGOMUGYS.js";
|
|
121
130
|
|
|
122
131
|
// src/workflow-wake-contract.ts
|
|
123
132
|
var SESSION_WORKFLOW_WAKE_DISPATCHER_SCHEDULE_ID = "opengeni-session-workflow-wake-dispatcher";
|
|
@@ -1635,14 +1644,19 @@ async function resolveAccessContext(c, deps) {
|
|
|
1635
1644
|
}
|
|
1636
1645
|
}
|
|
1637
1646
|
if (deps.managedAuth) {
|
|
1638
|
-
const session = await getManagedSession(c, deps.managedAuth, {
|
|
1647
|
+
const session = await getManagedSession(c, deps.managedAuth, {
|
|
1648
|
+
db: deps.db,
|
|
1649
|
+
sessionSetMode: deps.settings.managedAuthSessionSetMode,
|
|
1650
|
+
sessionAdapter: deps.managedAuthSessionAdapter
|
|
1651
|
+
});
|
|
1639
1652
|
if (session?.user) {
|
|
1640
1653
|
const context = await ensureManagedAccessForUser(deps.db, {
|
|
1641
1654
|
userId: session.user.id,
|
|
1642
1655
|
email: session.user.email,
|
|
1643
1656
|
name: session.user.name,
|
|
1644
1657
|
emailVerified: session.user.emailVerified,
|
|
1645
|
-
provisionFallbackOrganization: false
|
|
1658
|
+
provisionFallbackOrganization: false,
|
|
1659
|
+
bindPendingInvitations: false
|
|
1646
1660
|
});
|
|
1647
1661
|
canonicalManagedCookieContexts.add(context);
|
|
1648
1662
|
return context;
|
|
@@ -8202,6 +8216,7 @@ async function postUserMessageTurn(input) {
|
|
|
8202
8216
|
annotations: input.annotations ?? [],
|
|
8203
8217
|
modelContext: input.modelContext ?? null,
|
|
8204
8218
|
resources: input.resources,
|
|
8219
|
+
...input.composerDraftResources ? { composerDraftResources: input.composerDraftResources } : {},
|
|
8205
8220
|
model: requestedModel,
|
|
8206
8221
|
reasoningEffort: requestedReasoningEffort,
|
|
8207
8222
|
latencyMode: input.latencyMode ?? null,
|
|
@@ -9025,6 +9040,18 @@ async function acceptSessionUserMessageWithOutcome(deps, grant, workspaceId, ses
|
|
|
9025
9040
|
latencyModeSource: input.latencyMode == null ? "session" : "explicit"
|
|
9026
9041
|
});
|
|
9027
9042
|
const requestedResources = normalizeResources(input.resources ?? []);
|
|
9043
|
+
const composerDraftResources = input.composerDraftResources ? normalizeResources(input.composerDraftResources) : void 0;
|
|
9044
|
+
if (composerDraftResources) {
|
|
9045
|
+
const acceptedResources = new Set(requestedResources.map((resource) => stableJson4(resource)));
|
|
9046
|
+
const unacceptedDraftResource = composerDraftResources.find(
|
|
9047
|
+
(resource) => !acceptedResources.has(stableJson4(resource))
|
|
9048
|
+
);
|
|
9049
|
+
if (unacceptedDraftResource) {
|
|
9050
|
+
throw new HTTPException11(422, {
|
|
9051
|
+
message: "composer draft resources must be included in the accepted resource set"
|
|
9052
|
+
});
|
|
9053
|
+
}
|
|
9054
|
+
}
|
|
9028
9055
|
const annotations = await validateSubmittedTimelineAnnotations(
|
|
9029
9056
|
db,
|
|
9030
9057
|
workspaceId,
|
|
@@ -9099,6 +9126,7 @@ async function acceptSessionUserMessageWithOutcome(deps, grant, workspaceId, ses
|
|
|
9099
9126
|
annotations,
|
|
9100
9127
|
modelContext: input.modelContext ?? null,
|
|
9101
9128
|
resources: requestedResources,
|
|
9129
|
+
...composerDraftResources ? { composerDraftResources } : {},
|
|
9102
9130
|
model: input.model ?? null,
|
|
9103
9131
|
reasoningEffort: input.reasoningEffort ?? null,
|
|
9104
9132
|
latencyMode: input.latencyMode ?? null,
|
|
@@ -13307,6 +13335,42 @@ async function saveActorNewSessionDraft(deps, grant, workspaceId, rawInput, cano
|
|
|
13307
13335
|
}
|
|
13308
13336
|
}
|
|
13309
13337
|
|
|
13338
|
+
// src/application/composer-submit.ts
|
|
13339
|
+
async function submitComposerDraftForRequest(deps, grant, workspaceId, sessionId, input, options = {}) {
|
|
13340
|
+
const additionalResources = options.additionalResources ?? [];
|
|
13341
|
+
const result = await acceptSessionUserMessageWithOutcome(deps, grant, workspaceId, sessionId, {
|
|
13342
|
+
text: input.text,
|
|
13343
|
+
annotations: input.annotations,
|
|
13344
|
+
modelContext: input.modelContext ?? null,
|
|
13345
|
+
resources: [...input.resources, ...additionalResources],
|
|
13346
|
+
...additionalResources.length > 0 ? { composerDraftResources: input.resources } : {},
|
|
13347
|
+
model: input.model,
|
|
13348
|
+
reasoningEffort: input.reasoningEffort,
|
|
13349
|
+
latencyMode: input.latencyMode,
|
|
13350
|
+
mcpCredentialUpdates: input.mcpCredentialUpdates ?? [],
|
|
13351
|
+
connectionAuthorities: input.connectionAuthorities,
|
|
13352
|
+
...input.personalResourceAttachment ? { personalResourceAttachment: input.personalResourceAttachment } : {},
|
|
13353
|
+
...options.authorization ? { authorization: options.authorization } : {},
|
|
13354
|
+
delivery: input.delivery,
|
|
13355
|
+
origin: "human",
|
|
13356
|
+
expectedDraftRevision: input.expectedDraftRevision,
|
|
13357
|
+
clientEventId: input.clientEventId,
|
|
13358
|
+
...input.controlEtag ? { controlEtag: input.controlEtag } : {}
|
|
13359
|
+
});
|
|
13360
|
+
if (!result.draft) {
|
|
13361
|
+
throw new Error("Accepted composer draft submission did not return its next draft");
|
|
13362
|
+
}
|
|
13363
|
+
return {
|
|
13364
|
+
accepted: result.accepted,
|
|
13365
|
+
turn: result.turn,
|
|
13366
|
+
draft: result.draft,
|
|
13367
|
+
receipt: result.receipt,
|
|
13368
|
+
routing: result.routing,
|
|
13369
|
+
interruptionCount: result.interruptionCount,
|
|
13370
|
+
replay: result.replay
|
|
13371
|
+
};
|
|
13372
|
+
}
|
|
13373
|
+
|
|
13310
13374
|
// src/application/session-commands.ts
|
|
13311
13375
|
import { DraftTimelineAnnotations as DraftTimelineAnnotations3 } from "@opengeni/contracts";
|
|
13312
13376
|
import {
|
|
@@ -13618,24 +13682,30 @@ async function controlAgentSessionWorkstream(deps, context, input) {
|
|
|
13618
13682
|
}
|
|
13619
13683
|
);
|
|
13620
13684
|
scheduleSessionCommandPostCommit(deps, "agent_control", [
|
|
13621
|
-
|
|
13622
|
-
|
|
13623
|
-
|
|
13624
|
-
|
|
13625
|
-
|
|
13626
|
-
|
|
13627
|
-
|
|
13628
|
-
|
|
13629
|
-
|
|
13630
|
-
|
|
13631
|
-
|
|
13632
|
-
|
|
13633
|
-
|
|
13634
|
-
|
|
13635
|
-
|
|
13636
|
-
|
|
13637
|
-
|
|
13638
|
-
|
|
13685
|
+
...result.sessionControlEventId ? [
|
|
13686
|
+
{
|
|
13687
|
+
kind: "session_event_fanout",
|
|
13688
|
+
run: async () => await publishSessionEventIds(deps, context.workspaceId, input.targetSessionId, [
|
|
13689
|
+
result.sessionControlEventId
|
|
13690
|
+
])
|
|
13691
|
+
}
|
|
13692
|
+
] : [],
|
|
13693
|
+
...result.workspaceControlEventId ? [
|
|
13694
|
+
{
|
|
13695
|
+
kind: "workspace_control_fanout",
|
|
13696
|
+
run: async () => await publishWorkspaceControlEvent(
|
|
13697
|
+
deps,
|
|
13698
|
+
context.workspaceId,
|
|
13699
|
+
result.workspaceControlEventId
|
|
13700
|
+
)
|
|
13701
|
+
}
|
|
13702
|
+
] : [],
|
|
13703
|
+
...result.wakeCount > 0 ? [
|
|
13704
|
+
{
|
|
13705
|
+
kind: "workflow_wake",
|
|
13706
|
+
run: async () => await requestControlWakeDispatch(deps, result.wakeCount)
|
|
13707
|
+
}
|
|
13708
|
+
] : [],
|
|
13639
13709
|
{
|
|
13640
13710
|
kind: "workflow_wake",
|
|
13641
13711
|
run: async () => {
|
|
@@ -13908,18 +13978,22 @@ async function controlHumanSessionWorkstreamWithOutcome(deps, context, input) {
|
|
|
13908
13978
|
affected.eventIds
|
|
13909
13979
|
)
|
|
13910
13980
|
})),
|
|
13911
|
-
|
|
13912
|
-
|
|
13913
|
-
|
|
13914
|
-
|
|
13915
|
-
|
|
13916
|
-
|
|
13917
|
-
|
|
13918
|
-
|
|
13919
|
-
|
|
13920
|
-
|
|
13921
|
-
|
|
13922
|
-
|
|
13981
|
+
...result.workspaceControlEventId ? [
|
|
13982
|
+
{
|
|
13983
|
+
kind: "workspace_control_fanout",
|
|
13984
|
+
run: async () => await publishWorkspaceControlEvent(
|
|
13985
|
+
deps,
|
|
13986
|
+
context.workspaceId,
|
|
13987
|
+
result.workspaceControlEventId
|
|
13988
|
+
)
|
|
13989
|
+
}
|
|
13990
|
+
] : [],
|
|
13991
|
+
...result.wakeCount > 0 ? [
|
|
13992
|
+
{
|
|
13993
|
+
kind: "workflow_wake",
|
|
13994
|
+
run: async () => await requestControlWakeDispatch(deps, result.wakeCount)
|
|
13995
|
+
}
|
|
13996
|
+
] : [],
|
|
13923
13997
|
{
|
|
13924
13998
|
kind: "workflow_wake",
|
|
13925
13999
|
run: async () => {
|
|
@@ -13937,7 +14011,7 @@ async function controlHumanSessionWorkstreamWithOutcome(deps, context, input) {
|
|
|
13937
14011
|
}
|
|
13938
14012
|
}
|
|
13939
14013
|
]);
|
|
13940
|
-
return { response, replay: result.replay };
|
|
14014
|
+
return { response, outcome: result.outcome, replay: result.replay };
|
|
13941
14015
|
}
|
|
13942
14016
|
async function controlHumanSessionWorkstream(deps, context, input) {
|
|
13943
14017
|
return (await controlHumanSessionWorkstreamWithOutcome(deps, context, input)).response;
|
|
@@ -13967,18 +14041,22 @@ async function controlHumanWorkspace(deps, context, input) {
|
|
|
13967
14041
|
wakeCount: result.wakeCount
|
|
13968
14042
|
};
|
|
13969
14043
|
scheduleSessionCommandPostCommit(deps, "human_workspace_control", [
|
|
13970
|
-
|
|
13971
|
-
|
|
13972
|
-
|
|
13973
|
-
|
|
13974
|
-
|
|
13975
|
-
|
|
13976
|
-
|
|
13977
|
-
|
|
13978
|
-
|
|
13979
|
-
|
|
13980
|
-
|
|
13981
|
-
|
|
14044
|
+
...result.workspaceControlEventId ? [
|
|
14045
|
+
{
|
|
14046
|
+
kind: "workspace_control_fanout",
|
|
14047
|
+
run: async () => await publishWorkspaceControlEvent(
|
|
14048
|
+
deps,
|
|
14049
|
+
context.workspaceId,
|
|
14050
|
+
result.workspaceControlEventId
|
|
14051
|
+
)
|
|
14052
|
+
}
|
|
14053
|
+
] : [],
|
|
14054
|
+
...result.wakeCount > 0 ? [
|
|
14055
|
+
{
|
|
14056
|
+
kind: "workflow_wake",
|
|
14057
|
+
run: async () => await requestControlWakeDispatch(deps, result.wakeCount)
|
|
14058
|
+
}
|
|
14059
|
+
] : []
|
|
13982
14060
|
]);
|
|
13983
14061
|
return response;
|
|
13984
14062
|
}
|
|
@@ -14202,6 +14280,7 @@ export {
|
|
|
14202
14280
|
MEMORY_SLACK_PROJECTION_MAX_UTF8_BYTES,
|
|
14203
14281
|
MEMORY_SLACK_PROJECTION_VERSION,
|
|
14204
14282
|
MEMORY_SLACK_SUMMARY_MAX_UTF8_BYTES,
|
|
14283
|
+
ManagedAuthActorLeaseOutcomeUnknownError,
|
|
14205
14284
|
MathEditableArtifactOutboxRandom,
|
|
14206
14285
|
OPENGENI_PR_REVIEW_AGENT_INSTRUCTIONS,
|
|
14207
14286
|
OPENGENI_PR_REVIEW_SKILL,
|
|
@@ -14368,6 +14447,10 @@ export {
|
|
|
14368
14447
|
getAutomationAdapter,
|
|
14369
14448
|
getCapabilityPack,
|
|
14370
14449
|
getHumanComposerDraft,
|
|
14450
|
+
getManagedAuthRequestActorAbortSignal,
|
|
14451
|
+
getManagedAuthRequestActorAdmissionStamp,
|
|
14452
|
+
getManagedAuthRequestActorEpoch,
|
|
14453
|
+
getManagedAuthRequestActorLeaseStamp,
|
|
14371
14454
|
getManagedHumanSessionCreateCapabilities,
|
|
14372
14455
|
getManagedSession,
|
|
14373
14456
|
getWorkspaceInsights,
|
|
@@ -14405,6 +14488,7 @@ export {
|
|
|
14405
14488
|
loadRigDefaultVariableSetEnvironment,
|
|
14406
14489
|
manualScheduledTaskTriggerUsageKey,
|
|
14407
14490
|
manualScheduledTaskTriggerWorkflowId,
|
|
14491
|
+
markManagedAuthRequestActorTransitionApplied,
|
|
14408
14492
|
memberCanAdminister,
|
|
14409
14493
|
mergeCausalFrontiers,
|
|
14410
14494
|
mergeResourceRefs,
|
|
@@ -14465,6 +14549,7 @@ export {
|
|
|
14465
14549
|
registerAutomationAdapter,
|
|
14466
14550
|
relayConfigFromSettings,
|
|
14467
14551
|
relayDialBaseFromSettings,
|
|
14552
|
+
releaseManagedAuthRequestActorLease,
|
|
14468
14553
|
rememberConfirmationLabel,
|
|
14469
14554
|
reportSessionUsageRecordingFailure,
|
|
14470
14555
|
requireAccessContext,
|
|
@@ -14546,6 +14631,7 @@ export {
|
|
|
14546
14631
|
statusForVoiceInputError,
|
|
14547
14632
|
steerAgentSession,
|
|
14548
14633
|
steerHumanQueuePrompt,
|
|
14634
|
+
submitComposerDraftForRequest,
|
|
14549
14635
|
swapActiveSandbox,
|
|
14550
14636
|
syncCreatedScheduledTask,
|
|
14551
14637
|
syncUpdatedScheduledTask,
|
|
@@ -14564,6 +14650,7 @@ export {
|
|
|
14564
14650
|
validateGitHubRepositorySelectionShape,
|
|
14565
14651
|
validateGitHubRepositorySelectionShapes,
|
|
14566
14652
|
validateIncidentTelemetryPreflightSelection,
|
|
14653
|
+
validateManagedAuthRequestActorLease,
|
|
14567
14654
|
validateMcpCapabilityConnection,
|
|
14568
14655
|
validateOpenGeniSlackBotConnectionSelection,
|
|
14569
14656
|
validateScheduledTaskTarget,
|