@opengeni/core 0.3.0 → 0.4.1
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 +9 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
- package/src/dependencies.ts +2 -0
- package/src/domain/sessions.ts +11 -0
package/README.md
CHANGED
|
@@ -12,3 +12,12 @@ It owns code that is not intrinsically HTTP or Temporal process bootstrapping:
|
|
|
12
12
|
`@opengeni/api-router` owns the Hono app, middleware, HTTP route adapters, MCP HTTP transport, and API-direct sandbox endpoints. `@opengeni/worker-bundle` owns Temporal worker construction, workflows, activities, and process lifecycle. Both consume `@opengeni/core`; core does not import either app.
|
|
13
13
|
|
|
14
14
|
The package is used by standalone OpenGeni through those app runners and by embedded hosts that call core directly or mount the API router.
|
|
15
|
+
|
|
16
|
+
## Scope honesty: engine-core, not domain-core
|
|
17
|
+
|
|
18
|
+
This package is the **engine core** — the transport-mostly-neutral heart of the
|
|
19
|
+
server, extracted so embedders can mount it. It still carries server-flavored
|
|
20
|
+
dependencies (notably Hono's `HTTPException` as the domain error type and the
|
|
21
|
+
full persistence/runtime closure). It is NOT a pure domain library and does not
|
|
22
|
+
try to be one; if you need OpenGeni without any server runtime, you want the
|
|
23
|
+
REST API + `@opengeni/sdk` instead.
|
package/dist/index.d.ts
CHANGED
|
@@ -100,6 +100,7 @@ type SessionWorkflowClient = {
|
|
|
100
100
|
agentRunUsageIdempotencyKey?: string;
|
|
101
101
|
triggerWorkflowId?: string;
|
|
102
102
|
}) => Promise<void>;
|
|
103
|
+
check?: () => Promise<void>;
|
|
103
104
|
};
|
|
104
105
|
type DocumentIndexClient = {
|
|
105
106
|
indexDocument: (input: {
|
|
@@ -116,6 +117,7 @@ type AppDependencies = {
|
|
|
116
117
|
documentIndexer?: DocumentIndexClient;
|
|
117
118
|
documentServices?: DocumentServices;
|
|
118
119
|
observability?: Observability;
|
|
120
|
+
readinessChecks?: Partial<Record<"db" | "nats" | "temporal", () => Promise<void> | void>>;
|
|
119
121
|
githubStateSecret?: string;
|
|
120
122
|
managedAuth?: ManagedAuth | null;
|
|
121
123
|
sandboxClient?: ApiSandboxClient;
|
|
@@ -554,6 +556,7 @@ declare function createAndStartSession(input: {
|
|
|
554
556
|
name: string;
|
|
555
557
|
} | null;
|
|
556
558
|
goal?: GoalSpec | null;
|
|
559
|
+
instructions?: string | null;
|
|
557
560
|
firstPartyMcpPermissions?: Permission[] | null;
|
|
558
561
|
mcpServers?: CreateSessionMcpServerInput[];
|
|
559
562
|
sessionMcpServers?: SessionMcpServerMetadata[];
|
|
@@ -574,6 +577,7 @@ declare function createAndStartSession(input: {
|
|
|
574
577
|
initialMessage: string;
|
|
575
578
|
title: string | null;
|
|
576
579
|
titleSource: "user" | "agent" | null;
|
|
580
|
+
instructions: string | null;
|
|
577
581
|
resources: ({
|
|
578
582
|
kind: "repository";
|
|
579
583
|
uri: string;
|
package/dist/index.js
CHANGED
|
@@ -2034,6 +2034,7 @@ async function createAndStartSession(input) {
|
|
|
2034
2034
|
sandboxBackend: input.sandboxBackend,
|
|
2035
2035
|
environmentId: input.environment?.id ?? null,
|
|
2036
2036
|
firstPartyMcpPermissions: input.firstPartyMcpPermissions ?? null,
|
|
2037
|
+
instructions: input.instructions ?? null,
|
|
2037
2038
|
parentSessionId: input.parentSessionId ?? null,
|
|
2038
2039
|
createIdempotencyKey: input.createIdempotencyKey,
|
|
2039
2040
|
sandboxGroupId: input.sandboxGroupId ?? null,
|
|
@@ -2056,6 +2057,7 @@ async function createAndStartSession(input) {
|
|
|
2056
2057
|
sandboxBackend: input.sandboxBackend,
|
|
2057
2058
|
environmentId: input.environment?.id ?? null,
|
|
2058
2059
|
firstPartyMcpPermissions: input.firstPartyMcpPermissions ?? null,
|
|
2060
|
+
instructions: input.instructions ?? null,
|
|
2059
2061
|
parentSessionId: input.parentSessionId ?? null,
|
|
2060
2062
|
sandboxGroupId: input.sandboxGroupId ?? null,
|
|
2061
2063
|
...input.sandboxOs ? { sandboxOs: input.sandboxOs } : {},
|
|
@@ -2371,6 +2373,10 @@ async function createSessionForRequest(deps, grant, workspaceId, rawPayload) {
|
|
|
2371
2373
|
metadata: payload.metadata,
|
|
2372
2374
|
environment: environment ? { id: environment.id, name: environment.name } : null,
|
|
2373
2375
|
goal: payload.goal ?? null,
|
|
2376
|
+
// Per-session persona instructions (already trimmed/validated by the
|
|
2377
|
+
// contracts schema). Persisted on the row; composed system-level at turn
|
|
2378
|
+
// time. Not surfaced as an event.
|
|
2379
|
+
instructions: payload.instructions ?? null,
|
|
2374
2380
|
firstPartyMcpPermissions,
|
|
2375
2381
|
mcpServers: sessionMcpServers.dbServers,
|
|
2376
2382
|
sessionMcpServers: sessionMcpServers.metadata,
|