@opengeni/core 3.0.1-canary.0 → 3.0.1-canary.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeni/core",
3
- "version": "3.0.1-canary.0",
3
+ "version": "3.0.1-canary.2",
4
4
  "description": "OpenGeni framework-agnostic core: the domain, access, and billing layers (neutral access, off-HTTP V2 surface). Behavior-preserving extraction from apps/api — keeps Hono's HTTPException for error throwing (typed-errors cleanup deferred).",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -58,17 +58,17 @@
58
58
  },
59
59
  "dependencies": {
60
60
  "@modelcontextprotocol/sdk": "^1.29.0",
61
- "@opengeni/capabilities": "^0.3.4-canary.0",
62
- "@opengeni/codex": "^0.2.23-canary.2",
63
- "@opengeni/config": "^1.2.2-canary.0",
64
- "@opengeni/contracts": "^4.1.0-canary.0",
65
- "@opengeni/db": "^5.0.1-canary.0",
66
- "@opengeni/documents": "^0.8.30-canary.0",
67
- "@opengeni/events": "^0.4.28-canary.0",
68
- "@opengeni/network": "^0.3.1-canary.17",
69
- "@opengeni/observability": "^0.8.29-canary.0",
70
- "@opengeni/runtime": "^3.0.1-canary.0",
71
- "@opengeni/storage": "^0.2.130-canary.0",
61
+ "@opengeni/capabilities": "^0.3.4-canary.2",
62
+ "@opengeni/codex": "^0.2.23-canary.4",
63
+ "@opengeni/config": "^1.2.2-canary.2",
64
+ "@opengeni/contracts": "^4.1.0-canary.2",
65
+ "@opengeni/db": "^5.0.1-canary.2",
66
+ "@opengeni/documents": "^0.8.30-canary.2",
67
+ "@opengeni/events": "^0.4.28-canary.2",
68
+ "@opengeni/network": "^0.3.1-canary.19",
69
+ "@opengeni/observability": "^0.8.29-canary.2",
70
+ "@opengeni/runtime": "^3.0.1-canary.2",
71
+ "@opengeni/storage": "^0.2.130-canary.2",
72
72
  "hono": "^4.12.18",
73
73
  "zod": "^4.2.1"
74
74
  },
@@ -76,6 +76,7 @@ export type EditableArtifactAgentContext = Readonly<{
76
76
 
77
77
  export type EditableArtifactAgentMetadata = Readonly<{
78
78
  id: string;
79
+ artifactReference: string;
79
80
  modality: EditableArtifactModality;
80
81
  title: string;
81
82
  lifecycle: EditableArtifact["lifecycle"];
@@ -174,6 +175,14 @@ export type EditableArtifactAgentApplicationDependencies = Readonly<{
174
175
  exports: EditableArtifactDurableExportService;
175
176
  associations: EditableArtifactAgentAssociationPort;
176
177
  inspector: EditableArtifactAgentInspectionKernelPort;
178
+ /** Production persists proof only after a successful native query. */
179
+ recordInspection?: (
180
+ input: EditableArtifactAgentContext & {
181
+ artifact: EditableArtifactAgentMetadata;
182
+ queryHash: string;
183
+ queryKind: string;
184
+ },
185
+ ) => Promise<string>;
177
186
  officeImports: EditableArtifactOfficeImportPort;
178
187
  workspaceFiles: EditableArtifactAgentWorkspaceFilePort;
179
188
  }>;
@@ -291,7 +300,13 @@ export class EditableArtifactAgentApplication {
291
300
  async inspect(
292
301
  input: EditableArtifactAgentContext &
293
302
  Readonly<{ artifactId: EditableArtifactId; request: EditableArtifactAgentQuery }>,
294
- ): Promise<Readonly<{ artifact: EditableArtifactAgentMetadata; projection: unknown }>> {
303
+ ): Promise<
304
+ Readonly<{
305
+ artifact: EditableArtifactAgentMetadata;
306
+ projection: unknown;
307
+ inspectionReceiptId?: string;
308
+ }>
309
+ > {
295
310
  const context = agentContext(input);
296
311
  const artifactId = editableArtifactId(input.artifactId);
297
312
  const state = await this.dependencies.domain.readCurrentKernelState({
@@ -304,8 +319,21 @@ export class EditableArtifactAgentApplication {
304
319
  const queryBytes = encodeQuery(input.request);
305
320
  const responseBytes = await this.dependencies.inspector.query({ state, queryBytes });
306
321
  const projection = decodeQueryResponse(input.request.modality, responseBytes);
322
+ const inspectionReceiptId =
323
+ state.modality === "document"
324
+ ? await this.dependencies.recordInspection?.({
325
+ ...context,
326
+ artifact: projectArtifact(state.artifact),
327
+ queryHash: createHash("sha256").update(queryBytes).digest("hex"),
328
+ queryKind: input.request.query.kind,
329
+ })
330
+ : undefined;
307
331
  await this.touch(context, artifactId);
308
- return Object.freeze({ artifact: projectArtifact(state.artifact), projection });
332
+ return Object.freeze({
333
+ artifact: projectArtifact(state.artifact),
334
+ projection,
335
+ ...(inspectionReceiptId ? { inspectionReceiptId } : {}),
336
+ });
309
337
  }
310
338
 
311
339
  async apply(
@@ -603,6 +631,7 @@ function commandProtocolVersion(modality: EditableArtifactModality): number {
603
631
  function projectArtifact(artifact: EditableArtifact): EditableArtifactAgentMetadata {
604
632
  return Object.freeze({
605
633
  id: artifact.id,
634
+ artifactReference: `[Open report](/workspaces/${artifact.scope.workspaceId}/artifacts/editable/${artifact.id})`,
606
635
  modality: artifact.modality,
607
636
  title: artifact.title,
608
637
  lifecycle: artifact.lifecycle,
@@ -91,6 +91,7 @@ import {
91
91
  assertWorkspaceModelPolicyAllows,
92
92
  canonicalConfiguredModel,
93
93
  creationInitiatorForGrant,
94
+ settingsWithSessionMcpServerMetadata,
94
95
  } from "./sessions";
95
96
  import {
96
97
  hasReservedOpenGeniSlackBotSessionMetadata,
@@ -297,6 +298,13 @@ export async function createValidatedScheduledTask(input: {
297
298
  input.settings,
298
299
  { subjectId: input.grant.subjectId },
299
300
  );
301
+ // Existing-session runs use the target's persisted MCP configuration, with
302
+ // session definitions taking precedence over deployment servers of the same
303
+ // ID. Metadata selects the destination; captured grants still supply authority.
304
+ const hostRuntimeSettings =
305
+ runtimeSettings && target
306
+ ? settingsWithSessionMcpServerMetadata(runtimeSettings, target.mcpServers)
307
+ : runtimeSettings;
300
308
  const personalConnectionDelegations =
301
309
  knowledgeAction || !runtimeSettings
302
310
  ? []
@@ -370,20 +378,20 @@ export async function createValidatedScheduledTask(input: {
370
378
  variableSetId: input.payload.variableSetId ?? null,
371
379
  rigId: input.payload.rigId ?? null,
372
380
  metadata: input.payload.metadata,
373
- ...(hostSelections?.length && runtimeSettings
381
+ ...(hostSelections?.length && hostRuntimeSettings
374
382
  ? {
375
383
  captureHostAuthority: prepareHostMcpTaskAdmission({
376
- settings: runtimeSettings,
384
+ settings: hostRuntimeSettings,
377
385
  tools: target?.tools ?? agentConfig.tools,
378
386
  grant: input.grant,
379
387
  ...(input.authorization ? { authorization: input.authorization } : {}),
380
388
  selections: hostSelections,
381
389
  }),
382
390
  }
383
- : hostSelections === undefined && creationInitiator.actor && runtimeSettings
391
+ : hostSelections === undefined && creationInitiator.actor && hostRuntimeSettings
384
392
  ? {
385
393
  captureHostAuthority: prepareInheritedHostMcpTaskAdmission(
386
- runtimeSettings,
394
+ hostRuntimeSettings,
387
395
  target?.tools ?? agentConfig.tools,
388
396
  creationInitiator.actor,
389
397
  ),
@@ -1345,6 +1345,9 @@ async function finishStartSession(
1345
1345
  ...(input.goal.rootConstraints !== undefined
1346
1346
  ? { rootConstraints: input.goal.rootConstraints }
1347
1347
  : {}),
1348
+ ...(input.goal.reportRequirements !== undefined
1349
+ ? { reportRequirements: input.goal.reportRequirements }
1350
+ : {}),
1348
1351
  ...(input.goal.maxAutoContinuations !== undefined
1349
1352
  ? { maxAutoContinuations: input.goal.maxAutoContinuations }
1350
1353
  : {}),