@opengeni/core 2.8.3 → 2.9.3-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/external-actor-authority.d.ts +47 -0
- package/dist/access/index.d.ts +15 -1
- package/dist/application/connect-authority.d.ts +13 -0
- package/dist/application/connect-operation.d.ts +28 -0
- package/dist/application/external-continuation.d.ts +15 -0
- package/dist/application/external-identity-lifecycle.d.ts +20 -0
- package/dist/application/external-link-work-admission.d.ts +12 -0
- package/dist/application/external-workspace-members.d.ts +6 -0
- package/dist/application/host-mcp-owner.d.ts +6 -0
- package/dist/application/new-session-drafts.d.ts +2 -1
- package/dist/application/session-tenancy.d.ts +1 -0
- package/dist/dependencies.d.ts +2 -0
- package/dist/domain/capabilities.d.ts +19 -2
- package/dist/domain/external-creation-attribution.d.ts +6 -0
- package/dist/domain/host-mcp-task-admission.d.ts +18 -0
- package/dist/domain/product-integration-pack.d.ts +3 -9
- package/dist/domain/product-integration-skill.gen.d.ts +5 -0
- package/dist/domain/scheduled-tasks.d.ts +3 -0
- package/dist/domain/sessions.d.ts +15 -4
- package/dist/index.d.ts +7 -0
- package/dist/index.js +1231 -825
- package/dist/index.js.map +1 -1
- package/dist/remote-mcp-credentials.d.ts +8 -0
- package/dist/remote-mcp-credentials.js +219 -0
- package/dist/remote-mcp-credentials.js.map +1 -0
- package/dist/session-authorization.d.ts +5 -6
- package/package.json +17 -13
- package/src/access/external-actor-authority.ts +94 -0
- package/src/access/index.ts +255 -1
- package/src/application/connect-authority.ts +77 -0
- package/src/application/connect-operation.ts +51 -0
- package/src/application/external-continuation.ts +112 -0
- package/src/application/external-identity-lifecycle.ts +48 -0
- package/src/application/external-link-work-admission.ts +87 -0
- package/src/application/external-workspace-members.ts +95 -0
- package/src/application/host-mcp-owner.ts +41 -0
- package/src/application/new-session-drafts.ts +9 -2
- package/src/application/session-tenancy.ts +24 -3
- package/src/application/user-resource-grants.ts +2 -2
- package/src/dependencies.ts +2 -0
- package/src/domain/capabilities.ts +20 -4
- package/src/domain/external-creation-attribution.ts +22 -0
- package/src/domain/host-mcp-task-admission.ts +111 -0
- package/src/domain/product-integration-pack.ts +11 -464
- package/src/domain/product-integration-skill.gen.ts +52 -0
- package/src/domain/scheduled-tasks.ts +66 -5
- package/src/domain/sessions.ts +253 -23
- package/src/index.ts +7 -0
- package/src/remote-mcp-credentials.ts +293 -0
- package/src/session-authorization.ts +22 -17
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { Permission } from "@opengeni/contracts";
|
|
2
|
+
export type ExternalAuthoritySnapshot = Readonly<{
|
|
3
|
+
accountId: string;
|
|
4
|
+
externalIdentityId: string;
|
|
5
|
+
identityStatus: "active" | "disabled" | "revoked";
|
|
6
|
+
identityRevision: number;
|
|
7
|
+
membershipStatus: "active" | "provisioning" | "suspended" | "revoked";
|
|
8
|
+
workspaceId: string;
|
|
9
|
+
permissions: readonly Permission[];
|
|
10
|
+
}>;
|
|
11
|
+
export type ExternalLinkAuthoritySnapshot = Readonly<{
|
|
12
|
+
id: string;
|
|
13
|
+
accountId: string;
|
|
14
|
+
externalIdentityId: string;
|
|
15
|
+
revision: number;
|
|
16
|
+
nativeSubjectId: string;
|
|
17
|
+
status: "pending" | "active" | "revoked" | "expired";
|
|
18
|
+
expiresAt: number | null;
|
|
19
|
+
permissions: readonly Permission[];
|
|
20
|
+
nativeAuthority: Readonly<{
|
|
21
|
+
subjectId: string;
|
|
22
|
+
accountId: string;
|
|
23
|
+
workspaceId: string;
|
|
24
|
+
active: boolean;
|
|
25
|
+
permissions: readonly Permission[];
|
|
26
|
+
}>;
|
|
27
|
+
}>;
|
|
28
|
+
/** Pure permission calculation over already authenticated, live snapshots.
|
|
29
|
+
* This does not authenticate assertions or establish provenance. Callers must
|
|
30
|
+
* read snapshots under their authorization fence, never from request JSON.
|
|
31
|
+
* Linked mode uses the native lane alone: external workspace permissions must
|
|
32
|
+
* not be unioned into that lane, nor must old external resources change owner.
|
|
33
|
+
*/
|
|
34
|
+
export declare function externalActorPermissions(input: {
|
|
35
|
+
accountId: string;
|
|
36
|
+
workspaceId: string;
|
|
37
|
+
keyActive: boolean;
|
|
38
|
+
keyAccountId: string;
|
|
39
|
+
keyPermissions: readonly Permission[];
|
|
40
|
+
external: ExternalAuthoritySnapshot;
|
|
41
|
+
linked?: {
|
|
42
|
+
expectedId: string;
|
|
43
|
+
expectedRevision: number;
|
|
44
|
+
authority: ExternalLinkAuthoritySnapshot;
|
|
45
|
+
};
|
|
46
|
+
now: number;
|
|
47
|
+
}): Permission[];
|
package/dist/access/index.d.ts
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
1
|
import { type Settings } from "@opengeni/config";
|
|
2
|
-
import {
|
|
2
|
+
import { ExternalActorAttribution, type ExternalActorContinuation } from "@opengeni/contracts/external-identities";
|
|
3
|
+
import { type AccountGrant, type AccessContext, type AccessGrant, Permission, type Workspace } from "@opengeni/contracts";
|
|
3
4
|
import { type Database } from "@opengeni/db";
|
|
4
5
|
import type { Context } from "hono";
|
|
5
6
|
import type { ManagedAuth } from "../managed-auth-type.js";
|
|
6
7
|
import type { ManagedAuthSessionAdapter } from "../managed-auth-session-sets.js";
|
|
8
|
+
/** Creation audit only, never an authentication or delegation token. Metadata
|
|
9
|
+
* claiming to be external is insufficient; the exact resolver proof is needed. */
|
|
10
|
+
export declare function externalAttributionForAuthorization(authorization: AccessGrantAuthorization | undefined, grant: AccessGrant): ExternalActorAttribution | null;
|
|
11
|
+
export declare function externalActorContinuationForAuthorization(authorization: AccessGrantAuthorization): ExternalActorContinuation | null;
|
|
12
|
+
/** Dedicated owning-user proof. External admission never sets the native
|
|
13
|
+
* cookie stamp. The resource/session layer still checks the exact owner. */
|
|
14
|
+
export declare function hasVerifiedOwningUserAuthorization(authorization: AccessGrantAuthorization): boolean;
|
|
15
|
+
/** Request-local organization service-key proof, not a principal-kind claim. */
|
|
16
|
+
export declare function isVerifiedOrganizationServiceAuthorization(authorization: AccessGrantAuthorization): boolean;
|
|
7
17
|
export type AccountScopedApiKeyWorkspaceAuthority = Readonly<{
|
|
8
18
|
accountId: string;
|
|
9
19
|
permissions: Permission[];
|
|
@@ -32,6 +42,10 @@ export type AccessDeps = {
|
|
|
32
42
|
managedAuth?: ManagedAuth | null;
|
|
33
43
|
managedAuthSessionAdapter?: ManagedAuthSessionAdapter | null;
|
|
34
44
|
};
|
|
45
|
+
/** null means this is not an authenticated external lane; [] means that lane
|
|
46
|
+
* has no readable inventory. Callers must not fall back from [] to service or
|
|
47
|
+
* bare-subject discovery. */
|
|
48
|
+
export declare function listExternalActorWorkspaces(context: AccessContext, deps: AccessDeps): Promise<Workspace[] | null>;
|
|
35
49
|
export declare function requireAccessContext(c: Context, deps: AccessDeps): Promise<AccessContext>;
|
|
36
50
|
export declare function requireAccessGrant(c: Context, deps: AccessDeps, workspaceId: string, permission?: Permission): Promise<AccessGrant>;
|
|
37
51
|
/**
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Permission } from "@opengeni/contracts";
|
|
2
|
+
import type { ExternalActorContinuation } from "@opengeni/contracts/external-identities";
|
|
3
|
+
import { type Database } from "@opengeni/db";
|
|
4
|
+
/** Accept only a verified request owner or authenticated server-minted OAuth
|
|
5
|
+
* state. The callback does not need a browser cookie: it rechecks the stored
|
|
6
|
+
* principal against current authority before claiming and committing effects. */
|
|
7
|
+
export declare function requireConnectOwnerAuthority(db: Database, state: {
|
|
8
|
+
accountId: string;
|
|
9
|
+
workspaceId: string;
|
|
10
|
+
subjectId: string;
|
|
11
|
+
personalOwnerVerified?: boolean;
|
|
12
|
+
externalContinuation?: ExternalActorContinuation;
|
|
13
|
+
}, permission?: Permission, origin?: ExternalActorContinuation | null): Promise<void>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ConnectAttempt } from "@opengeni/contracts/connect";
|
|
2
|
+
import { type ConnectActorScope, type ConnectOperationAuthorization, type Database } from "@opengeni/db";
|
|
3
|
+
/** Provider result is deliberately not serializable: secrets can remain in its
|
|
4
|
+
* closure until encrypted credential persistence. Do not retain/log this value. */
|
|
5
|
+
export type PreparedConnectOperation = {
|
|
6
|
+
commit: (tx: Database, current: ConnectAttempt) => Promise<ConnectAttempt>;
|
|
7
|
+
};
|
|
8
|
+
/** Internal provider-adapter boundary, not an HTTP authentication adapter.
|
|
9
|
+
*
|
|
10
|
+
* authorize is mandatory, including for a receipt replay. It must validate the
|
|
11
|
+
* exact saved key/actor/link authority and current permission under database
|
|
12
|
+
* locks. execute owns provider-specific proof, destination and cancellation.
|
|
13
|
+
* No remote effects may occur inside authorize or commit.
|
|
14
|
+
*
|
|
15
|
+
* A failed execute/authorization/commit keeps the durable claim occupied. It
|
|
16
|
+
* does not release or retry work whose provider outcome may be unknown.
|
|
17
|
+
*/
|
|
18
|
+
export declare function executeConnectOperation(input: {
|
|
19
|
+
db: Database;
|
|
20
|
+
scope: ConnectActorScope;
|
|
21
|
+
attemptId: string;
|
|
22
|
+
expectedRevision: number;
|
|
23
|
+
operationId: string;
|
|
24
|
+
/** Caller computes a stable keyed digest if input contains low-entropy secrets. */
|
|
25
|
+
inputDigest: string;
|
|
26
|
+
authorize: ConnectOperationAuthorization;
|
|
27
|
+
execute: (attempt: ConnectAttempt) => Promise<PreparedConnectOperation>;
|
|
28
|
+
}): Promise<ConnectAttempt>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Permission } from "@opengeni/contracts";
|
|
2
|
+
import { type Database } from "@opengeni/db";
|
|
3
|
+
import { type AccessGrantAuthorization } from "../access/index.js";
|
|
4
|
+
/** Capture verified request authority before asynchronous preflight. Invoke
|
|
5
|
+
* inside the canonical mutation transaction after its lifecycle locks, so a
|
|
6
|
+
* revoked key/generation rolls the write back without changing lock order. */
|
|
7
|
+
export declare function externalContinuationCommitAuthorizer(authorization: AccessGrantAuthorization | undefined): ((tx: Database) => Promise<void>) | undefined;
|
|
8
|
+
/** Caller verifies/decrypts its server-minted continuation before invoking.
|
|
9
|
+
* An open transaction retains lifecycle/key/identity locks through persistence.
|
|
10
|
+
* Historical creator audit alone must never enter this path as a credential. */
|
|
11
|
+
export declare function requireExternalContinuationAuthority(tx: Database, raw: unknown, scope: {
|
|
12
|
+
accountId: string;
|
|
13
|
+
workspaceId: string;
|
|
14
|
+
subjectId: string;
|
|
15
|
+
}, permission: Permission | readonly Permission[]): Promise<void>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Context } from "hono";
|
|
2
|
+
import { type AccessDeps } from "../access/index.js";
|
|
3
|
+
/** Host service administration is separate from asUser and native-cookie
|
|
4
|
+
* administration. The database rechecks the live key and exact external target
|
|
5
|
+
* under the canonical organization lifecycle fences, including receipt replay. */
|
|
6
|
+
export declare function updateExternalIdentityMembershipForRequest(context: Context, deps: AccessDeps, organizationId: string, membershipId: string, input: unknown): Promise<{
|
|
7
|
+
id: string;
|
|
8
|
+
organizationId: string;
|
|
9
|
+
subjectId: string;
|
|
10
|
+
name: string | null;
|
|
11
|
+
email: string | null;
|
|
12
|
+
role: "admin" | "member" | "owner";
|
|
13
|
+
status: "active" | "provisioning" | "revoked" | "suspended";
|
|
14
|
+
authorizationRevision: number;
|
|
15
|
+
personalWorkspaceId: string | null;
|
|
16
|
+
revokedAt: string | null;
|
|
17
|
+
personalRetentionUntil: string | null;
|
|
18
|
+
createdAt: string;
|
|
19
|
+
updatedAt: string;
|
|
20
|
+
}>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ScheduledTask } from "@opengeni/contracts";
|
|
2
|
+
import { type Database } from "@opengeni/db";
|
|
3
|
+
import { type AccessGrantAuthorization } from "../access/index.js";
|
|
4
|
+
/** Closure is created only from the access resolver's object-identity proof.
|
|
5
|
+
* JSON metadata and an ordinary named native subject can never enter it. */
|
|
6
|
+
export declare function prepareExternalLinkTurnAdmission(authorization: AccessGrantAuthorization | undefined): ((tx: Database, sessionId: string, turnId: string) => Promise<void>) | undefined;
|
|
7
|
+
export declare function prepareExternalLinkTaskAdmission(authorization: AccessGrantAuthorization | undefined, actor?: {
|
|
8
|
+
sessionId: string;
|
|
9
|
+
turnId: string;
|
|
10
|
+
attemptId: string;
|
|
11
|
+
executionGeneration: number;
|
|
12
|
+
} | null): ((tx: Database, task: ScheduledTask) => Promise<void>) | undefined;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Context } from "hono";
|
|
2
|
+
import { type ExternalIdentity } from "@opengeni/contracts/external-identities";
|
|
3
|
+
import { type AccessDeps } from "../access/index.js";
|
|
4
|
+
/** Explicit host onboarding. Ordinary asUser reads never call this operation.
|
|
5
|
+
* Existing memberships are not overwritten, including reduced permissions. */
|
|
6
|
+
export declare function addExternalWorkspaceMemberForRequest(c: Context, deps: AccessDeps, workspaceId: string, input: unknown): Promise<ExternalIdentity>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type Database } from "@opengeni/db";
|
|
2
|
+
import { type AccessGrantAuthorization } from "../access/index.js";
|
|
3
|
+
/** Direct user admission only. Agents inherit exact accepted snapshots instead.
|
|
4
|
+
* Native and externally represented users share owner semantics; service keys
|
|
5
|
+
* cannot impersonate a human owner merely by naming a subject. */
|
|
6
|
+
export declare function prepareHostMcpOwnerAuthorization(authorization: AccessGrantAuthorization, workspaceId: string, permission: "connections:read" | "connections:write"): (tx: Database) => Promise<import("@opengeni/db").HostMcpBindingOwner>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type AccessGrant, type NewSessionDraft as NewSessionDraftValue } from "@opengeni/contracts";
|
|
2
2
|
import type { AppDependencies } from "../dependencies.js";
|
|
3
|
+
import { type AccessGrantAuthorization } from "../access/index.js";
|
|
3
4
|
type NewSessionDraftDependencies = Pick<AppDependencies, "settings" | "db" | "objectStorage">;
|
|
4
5
|
/** Read the authenticated actor's server-authoritative pre-session composer state. */
|
|
5
6
|
export declare function getActorNewSessionDraft(deps: Pick<NewSessionDraftDependencies, "settings" | "db">, grant: AccessGrant, workspaceId: string): Promise<NewSessionDraftValue>;
|
|
@@ -17,5 +18,5 @@ export declare function saveActorNewSessionDraft(deps: NewSessionDraftDependenci
|
|
|
17
18
|
* Defaults to false so every caller that has not proven it fails closed onto
|
|
18
19
|
* the historical bare-membership fence.
|
|
19
20
|
*/
|
|
20
|
-
canonicalManagedHumanSession?: boolean): Promise<NewSessionDraftValue>;
|
|
21
|
+
canonicalManagedHumanSession?: boolean, externalAuthorization?: AccessGrantAuthorization): Promise<NewSessionDraftValue>;
|
|
21
22
|
export {};
|
|
@@ -11,6 +11,7 @@ export declare class SessionTenancyPersistenceOutcomeUnknownError extends Error
|
|
|
11
11
|
constructor(options?: ErrorOptions);
|
|
12
12
|
}
|
|
13
13
|
export declare function requireCanonicalManagedHuman(authorization: AccessGrantAuthorization, workspaceId: string): void;
|
|
14
|
+
export declare function requireVerifiedOwningUser(authorization: AccessGrantAuthorization, workspaceId: string): void;
|
|
14
15
|
export declare function getManagedHumanSessionCreateCapabilities(deps: Pick<SessionTenancyDependencies, "db">, authorization: AccessGrantAuthorization, workspaceId: string): Promise<SessionTenancyCreateCapabilities>;
|
|
15
16
|
export declare function requireManagedHumanPrivateSessionCreate(deps: Pick<SessionTenancyDependencies, "db">, authorization: AccessGrantAuthorization, workspaceId: string): Promise<void>;
|
|
16
17
|
export declare function updateManagedHumanSessionVisibility(deps: SessionTenancyDependencies, authorization: AccessGrantAuthorization, workspaceId: string, sessionId: string, request: UpdateSessionVisibilityRequest, authorizationSurface?: SessionAuthorizationSurface): Promise<UpdateSessionVisibilityResponse>;
|
package/dist/dependencies.d.ts
CHANGED
|
@@ -193,6 +193,8 @@ export type AppDependencies = {
|
|
|
193
193
|
fikenFetch?: typeof fetch;
|
|
194
194
|
/** Injectable Integration Definition OAuth/API transport for deterministic tests. */
|
|
195
195
|
apiIntegrationOAuthFetch?: typeof fetch;
|
|
196
|
+
/** Injectable specification/introspection transport, still network-policy checked. */
|
|
197
|
+
apiIntegrationSourceFetch?: typeof fetch;
|
|
196
198
|
atlassianFetch?: typeof fetch;
|
|
197
199
|
/** Injectable MCP OAuth setup deadline for deterministic stalled-provider tests. */
|
|
198
200
|
oauthStartDeadlineMs?: number;
|
|
@@ -14,7 +14,7 @@ export declare function createCatalogItem(input: {
|
|
|
14
14
|
workspaceId: string;
|
|
15
15
|
payload: CreateCapabilityCatalogItemRequest;
|
|
16
16
|
}): Promise<CapabilityCatalogItem>;
|
|
17
|
-
|
|
17
|
+
type EnableCapabilityInput = {
|
|
18
18
|
db: Database;
|
|
19
19
|
grant: AccessGrant;
|
|
20
20
|
accountId: string;
|
|
@@ -23,7 +23,24 @@ export declare function enableCapability(input: {
|
|
|
23
23
|
capabilityId: string;
|
|
24
24
|
payload: EnableCapabilityRequest;
|
|
25
25
|
probeMcpServer?: McpCapabilityProbe;
|
|
26
|
-
}
|
|
26
|
+
};
|
|
27
|
+
export declare function enableCapability(input: EnableCapabilityInput): Promise<CapabilityInstallation>;
|
|
28
|
+
/** Probe outside a durable Connect commit; persist the exact prepared settings
|
|
29
|
+
* inside the caller's authorized receipt transaction. Native enable uses this too. */
|
|
30
|
+
export declare function prepareCapabilityEnable(input: EnableCapabilityInput): Promise<{
|
|
31
|
+
commit: (db: Database) => Promise<{
|
|
32
|
+
id: string;
|
|
33
|
+
accountId: string;
|
|
34
|
+
workspaceId: string;
|
|
35
|
+
capabilityId: string;
|
|
36
|
+
kind: "api" | "mcp" | "pack" | "plugin" | "skill";
|
|
37
|
+
status: "active" | "disabled";
|
|
38
|
+
config: Record<string, unknown>;
|
|
39
|
+
metadata: Record<string, unknown>;
|
|
40
|
+
enabledAt: string;
|
|
41
|
+
updatedAt: string;
|
|
42
|
+
}>;
|
|
43
|
+
}>;
|
|
27
44
|
export type McpCapabilityProbeInput = {
|
|
28
45
|
id: string;
|
|
29
46
|
name: string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AccessGrant } from "@opengeni/contracts";
|
|
2
|
+
import { type AccessGrantAuthorization } from "../access/index.js";
|
|
3
|
+
export declare const EXTERNAL_CREATION_ATTRIBUTION_KEY = "opengeniExternalCreationAttribution";
|
|
4
|
+
/** Retained alongside session.created metadata; this is not a live permission
|
|
5
|
+
* snapshot and must never authorize a follow-up, child, or scheduled turn. */
|
|
6
|
+
export declare function externalCreationMetadata(metadata: Record<string, unknown> | undefined, authorization: AccessGrantAuthorization | undefined, grant: AccessGrant): Record<string, unknown> | undefined;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Settings } from "@opengeni/config";
|
|
2
|
+
import type { ToolRef, ScheduledTask, AccessGrant } from "@opengeni/contracts";
|
|
3
|
+
import { type Database } from "@opengeni/db";
|
|
4
|
+
import { type AccessGrantAuthorization } from "../access/index.js";
|
|
5
|
+
/** Internal closure, not a caller-provided callback or durable key dependency. */
|
|
6
|
+
export declare function prepareHostMcpTaskAdmission(input: {
|
|
7
|
+
settings: Settings;
|
|
8
|
+
tools: ToolRef[];
|
|
9
|
+
grant: AccessGrant;
|
|
10
|
+
authorization?: AccessGrantAuthorization;
|
|
11
|
+
selections: unknown;
|
|
12
|
+
}): (tx: Database, task: ScheduledTask) => Promise<void>;
|
|
13
|
+
export declare function prepareInheritedHostMcpTaskAdmission(settings: Settings, tools: ToolRef[], source: {
|
|
14
|
+
sessionId: string;
|
|
15
|
+
turnId: string;
|
|
16
|
+
attemptId: string;
|
|
17
|
+
executionGeneration: number;
|
|
18
|
+
}): (tx: Database, task: ScheduledTask) => Promise<void>;
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
export declare const OPENGENI_PRODUCT_INTEGRATION_PACK_ID = "opengeni-product-integration";
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* This is intentionally an instruction-only Pack. Installation adds no tools,
|
|
6
|
-
* credentials, connectors, knowledge, compute, or customer-agent persona. Its
|
|
7
|
-
* immutable Skill is installed as session-selected and enters model context
|
|
8
|
-
* only when one implementation session opts in explicitly.
|
|
9
|
-
*/
|
|
2
|
+
/** Generated from the canonical external coding-agent guide, with an explicit
|
|
3
|
+
* session-selected wrapper. Installation grants no executable capabilities. */
|
|
10
4
|
export declare const OPENGENI_PRODUCT_INTEGRATION_SKILL: {
|
|
11
5
|
name: string;
|
|
12
6
|
description: string;
|
|
@@ -45,6 +39,6 @@ export declare const OPENGENI_PRODUCT_INTEGRATION_PACK: {
|
|
|
45
39
|
skillActivation: string;
|
|
46
40
|
installationExposure: string;
|
|
47
41
|
grantsExecutableCapabilities: boolean;
|
|
48
|
-
|
|
42
|
+
canonicalSource: string;
|
|
49
43
|
};
|
|
50
44
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const productIntegrationSkillDescription = "Design, implement, verify, and hand off a tenant-safe OpenGeni product integration while adapting to the customer's architecture, UI, data APIs, and desired delivery autonomy. Select only for an implementation session; installation alone does not expose it to other agents.";
|
|
2
|
+
export declare const productIntegrationSkillFiles: {
|
|
3
|
+
path: string;
|
|
4
|
+
content: string;
|
|
5
|
+
}[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Settings } from "@opengeni/config";
|
|
2
2
|
import type { AccessGrant, McpPersonalConnectionDelegation, ScheduledTask, ScheduledTaskAgentConfig, Session, SessionAuthorizationPort, SessionAuthorizationSurface, CreateScheduledTaskRequest as CreateScheduledTaskPayload, UpdateScheduledTaskRequest as UpdateScheduledTaskPayload } from "@opengeni/contracts";
|
|
3
3
|
import { type Database, type TemporalScheduleCleanupClaim, type UpdateScheduledTaskInput } from "@opengeni/db";
|
|
4
|
+
import { type AccessGrantAuthorization } from "../access/index.js";
|
|
4
5
|
import type { SessionWorkflowClient } from "../dependencies.js";
|
|
5
6
|
import type { ObjectStorageDependency } from "../dependencies.js";
|
|
6
7
|
/**
|
|
@@ -21,6 +22,7 @@ export declare function createValidatedScheduledTask(input: {
|
|
|
21
22
|
db: Database;
|
|
22
23
|
objectStorage: ObjectStorageDependency;
|
|
23
24
|
grant: AccessGrant;
|
|
25
|
+
authorization?: AccessGrantAuthorization;
|
|
24
26
|
payload: CreateScheduledTaskPayload;
|
|
25
27
|
toolsProvided?: boolean;
|
|
26
28
|
variableSetPreauthorized?: boolean;
|
|
@@ -70,6 +72,7 @@ export declare function validatedScheduledTaskUpdate(input: {
|
|
|
70
72
|
db: Database;
|
|
71
73
|
objectStorage: ObjectStorageDependency;
|
|
72
74
|
grant: AccessGrant;
|
|
75
|
+
authorization?: AccessGrantAuthorization;
|
|
73
76
|
existing: ScheduledTask;
|
|
74
77
|
payload: UpdateScheduledTaskPayload;
|
|
75
78
|
/** See createValidatedScheduledTask; only consulted when agentConfig is updated. */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { type HostMcpCreateSelection } from "@opengeni/contracts/host-mcp-bindings";
|
|
1
2
|
import { type Settings } from "@opengeni/config";
|
|
2
|
-
import { SessionSpawnDenial, type AccessGrant, type ComposerDraft, type CreateSessionResponse, type GoalSpec, type FirstPartyMcpToolName, type McpPersonalConnectionDelegation, type McpConnectionAuthoritySelection, type Permission, type PersonalResourceAttachmentIntent, type ReasoningEffort, type ResourceRef, type Session, type SessionAgentAccess, type SessionCommandReceipt, type
|
|
3
|
+
import { SessionSpawnDenial, type AccessGrant, type ComposerDraft, type CreateSessionResponse, type GoalSpec, type FirstPartyMcpToolName, type McpPersonalConnectionDelegation, type McpConnectionAuthoritySelection, type Permission, type PersonalResourceAttachmentIntent, type ReasoningEffort, type ResourceRef, type Session, type SessionAgentAccess, type SessionCommandReceipt, type SessionScopeSubjectId, type SessionMemoryScope, type SessionSkill, type SessionEvent, SessionMcpApprovalPolicy, type SessionMcpCredentialUpdateInput, type SessionMcpServerMetadata, type SubmittedTimelineAnnotation, type TimelineAnnotation, type UpdateSessionMcpApprovalPolicyResponse, type UpdateSessionToolPolicyRequest, type SessionAuthorizationPort, type SessionToolPolicy, type SessionTurn, type SessionPromptRouting, type SessionGoalSnapshot, type ToolRef, type TurnInitiator, type TurnInitiatorContext, type TurnExecutionPolicyV1, type VariableSet, type XaiProviderAccountAuthoritySnapshotV1 } from "@opengeni/contracts";
|
|
3
4
|
import { type CreateSessionMcpServerInput, type Database, type UpdateSessionMcpServerCredentialsInput, type SessionCommandActor, type NewSessionDraftSnapshot } from "@opengeni/db";
|
|
4
5
|
import { type EventBus } from "@opengeni/events";
|
|
5
6
|
import { type AccessGrantAuthorization } from "../access/index.js";
|
|
@@ -97,6 +98,13 @@ export declare function createAndStartSessionWithOutcome(input: {
|
|
|
97
98
|
/** Internal database-only composition seam. The exact session shell and this
|
|
98
99
|
* linkage commit together before its first event/turn can be initialized. */
|
|
99
100
|
beforeCreateCommit?: (tx: Database, sessionId: string) => Promise<void>;
|
|
101
|
+
/** Backend-only accepted-work composition. Recheck live caller authority
|
|
102
|
+
* here before capturing; session-shell authorization may have happened in
|
|
103
|
+
* an earlier transaction. Called only for a newly inserted initial turn. */
|
|
104
|
+
captureInitialTurnAuthority?: (tx: Database, sessionId: string, turnId: string) => Promise<void>;
|
|
105
|
+
/** Internal replay identity; the verified caller must also capture authority.
|
|
106
|
+
* Supplying selection metadata alone never grants runtime use. */
|
|
107
|
+
selectedHostMcpDelegations?: HostMcpCreateSelection[];
|
|
100
108
|
/** The custom workspace model was frozen by an earlier accepted boundary or
|
|
101
109
|
* inherited from an existing session, so retirement must not invalidate it. */
|
|
102
110
|
retainWorkspaceGatewayModel?: boolean;
|
|
@@ -149,7 +157,7 @@ export declare function createAndStartSessionWithOutcome(input: {
|
|
|
149
157
|
firstPartyMcpPermissions?: Permission[] | null;
|
|
150
158
|
firstPartyMcpTools: FirstPartyMcpToolName[];
|
|
151
159
|
agentAccess?: SessionAgentAccess;
|
|
152
|
-
|
|
160
|
+
scopeSubjectId?: SessionScopeSubjectId | null;
|
|
153
161
|
memoryScope?: SessionMemoryScope;
|
|
154
162
|
mcpServers?: CreateSessionMcpServerInput[];
|
|
155
163
|
sessionMcpServers?: SessionMcpServerMetadata[];
|
|
@@ -271,6 +279,8 @@ type PostUserMessageTurnInput = {
|
|
|
271
279
|
clientEventId?: string;
|
|
272
280
|
mcpCredentialUpdates?: UpdateSessionMcpServerCredentialsInput[];
|
|
273
281
|
personalConnectionDelegations?: McpPersonalConnectionDelegation[];
|
|
282
|
+
selectedHostMcpDelegations?: HostMcpCreateSelection[];
|
|
283
|
+
captureTurnAuthority?: (tx: Database, turnId: string) => Promise<void>;
|
|
274
284
|
personalResourceAttachment?: PersonalResourceAttachmentIntent;
|
|
275
285
|
delivery?: "send" | "steer";
|
|
276
286
|
origin?: "human" | "operator";
|
|
@@ -304,7 +314,7 @@ export declare function resolveSessionCreateVisibility(input: {
|
|
|
304
314
|
}): "user_private" | "workspace_shared";
|
|
305
315
|
export type SessionCreateScope = {
|
|
306
316
|
agentAccess: SessionAgentAccess;
|
|
307
|
-
|
|
317
|
+
scopeSubjectId: SessionScopeSubjectId | null;
|
|
308
318
|
memoryScope: SessionMemoryScope;
|
|
309
319
|
};
|
|
310
320
|
/**
|
|
@@ -321,7 +331,7 @@ export declare function resolveSessionCreateScope(input: {
|
|
|
321
331
|
requested: {
|
|
322
332
|
agentAccess: SessionAgentAccess;
|
|
323
333
|
agentAccessProvided: boolean;
|
|
324
|
-
|
|
334
|
+
scopeSubjectId: SessionScopeSubjectId | null;
|
|
325
335
|
endUserProvided: boolean;
|
|
326
336
|
memoryScope: SessionMemoryScope;
|
|
327
337
|
memoryScopeProvided: boolean;
|
|
@@ -353,6 +363,7 @@ export declare function acceptSessionUserMessageWithOutcome(deps: AcceptSessionU
|
|
|
353
363
|
clientEventId?: string;
|
|
354
364
|
mcpCredentialUpdates?: SessionMcpCredentialUpdateInput[];
|
|
355
365
|
connectionAuthorities?: McpConnectionAuthoritySelection[];
|
|
366
|
+
selectedHostMcpDelegations?: HostMcpCreateSelection[];
|
|
356
367
|
delivery?: "send" | "steer";
|
|
357
368
|
origin?: "human" | "operator";
|
|
358
369
|
controlEtag?: string | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,13 @@ export * from "./sandbox/fleet.js";
|
|
|
10
10
|
export * from "./sandbox/routing.js";
|
|
11
11
|
export * from "./sandbox/runtime-settings.js";
|
|
12
12
|
export * from "./access/index.js";
|
|
13
|
+
export * from "./application/external-workspace-members.js";
|
|
14
|
+
export * from "./application/external-identity-lifecycle.js";
|
|
15
|
+
export * from "./application/external-continuation.js";
|
|
16
|
+
export * from "./application/external-link-work-admission.js";
|
|
17
|
+
export * from "./application/connect-authority.js";
|
|
18
|
+
export * from "./application/host-mcp-owner.js";
|
|
19
|
+
export * from "./application/connect-operation.js";
|
|
13
20
|
export * from "./session-authorization.js";
|
|
14
21
|
export * from "./billing/limits.js";
|
|
15
22
|
export * from "./domain/capabilities.js";
|