@opengeni/core 0.28.1 → 2.1.0-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 +37 -0
- package/dist/application/new-session-drafts.d.ts +8 -1
- package/dist/application/session-commands.d.ts +18 -11
- package/dist/application/session-tenancy.d.ts +18 -0
- package/dist/application/user-resource-grants.d.ts +20 -0
- package/dist/{chunk-6WKPWE5S.js → chunk-H7X52RI2.js} +27 -18
- package/dist/chunk-H7X52RI2.js.map +1 -0
- package/dist/{chunk-JJU6I5XD.js → chunk-VCZFFEPB.js} +21 -9
- package/dist/chunk-VCZFFEPB.js.map +1 -0
- package/dist/{chunk-NYPMQ7NO.js → chunk-ZYCNLYGH.js} +29 -27
- package/dist/chunk-ZYCNLYGH.js.map +1 -0
- package/dist/dependencies.d.ts +12 -1
- package/dist/domain/automations.d.ts +51 -0
- package/dist/domain/company-brain-governed-writes.d.ts +70 -0
- package/dist/domain/company-profile-agent-admin.d.ts +24 -0
- package/dist/domain/connection-authority.d.ts +97 -0
- package/dist/domain/connection-authority.js +169 -0
- package/dist/domain/connection-authority.js.map +1 -0
- package/dist/domain/editable-artifacts/service.d.ts +1 -2
- package/dist/domain/environments.d.ts +1 -1
- package/dist/domain/github-repository-bindings.d.ts +117 -0
- package/dist/domain/governed-learning-activation.d.ts +16 -0
- package/dist/domain/governed-learning-evaluator.d.ts +6 -0
- package/dist/domain/governed-learning-slack-publication.d.ts +45 -0
- package/dist/domain/memory-slack-delivery.d.ts +1 -4
- package/dist/domain/organization-membership-lifecycle.d.ts +1 -0
- package/dist/domain/packs.d.ts +5 -1
- package/dist/domain/personal-connection-delegations.d.ts +44 -2
- package/dist/domain/pr-review.d.ts +149 -0
- package/dist/domain/remember.d.ts +69 -0
- package/dist/domain/resources.d.ts +23 -2
- package/dist/domain/scheduled-tasks.d.ts +43 -2
- package/dist/domain/session-tool-policy.d.ts +1 -1
- package/dist/domain/sessions.d.ts +43 -9
- package/dist/editable-artifact-live/application.d.ts +10 -2
- package/dist/editable-artifact-live/ports.d.ts +0 -1
- package/dist/editable-artifact-live/server.d.ts +0 -1
- package/dist/editable-artifact-live/ticket.d.ts +0 -1
- package/dist/editable-artifact-live/types.d.ts +5 -2
- package/dist/editable-artifact-live.js +2 -2
- package/dist/editable-artifacts.js +2 -4
- package/dist/index.d.ts +13 -1
- package/dist/index.js +4973 -1243
- package/dist/index.js.map +1 -1
- package/dist/rigs/index.d.ts +22 -5
- package/dist/sandbox/fleet.d.ts +34 -6
- package/dist/sandbox/routing.d.ts +15 -1
- package/dist/sandbox/runtime-settings.d.ts +39 -0
- package/package.json +16 -11
- package/src/access/index.ts +151 -31
- package/src/application/new-session-drafts.ts +32 -5
- package/src/application/session-commands.ts +305 -71
- package/src/application/session-tenancy.ts +321 -0
- package/src/application/user-resource-grants.ts +140 -0
- package/src/billing/limits.ts +25 -15
- package/src/dependencies.ts +12 -1
- package/src/domain/automations.ts +196 -0
- package/src/domain/capabilities.ts +7 -1
- package/src/domain/company-brain-governed-writes.ts +330 -0
- package/src/domain/company-profile-agent-admin.ts +55 -0
- package/src/domain/connection-authority.ts +329 -0
- package/src/domain/editable-artifacts/agent-application.ts +17 -9
- package/src/domain/editable-artifacts/service.ts +12 -1
- package/src/domain/editable-artifacts/snapshot-compaction.ts +9 -5
- package/src/domain/editable-artifacts/snapshot-verifier-genesis.ts +10 -8
- package/src/domain/editable-artifacts/snapshot-verifier.ts +10 -3
- package/src/domain/environments.ts +16 -3
- package/src/domain/github-repository-bindings.ts +295 -0
- package/src/domain/governed-learning-activation.ts +44 -0
- package/src/domain/governed-learning-evaluator.ts +49 -0
- package/src/domain/governed-learning-slack-publication.ts +157 -0
- package/src/domain/insights.ts +9 -0
- package/src/domain/memory-slack-delivery.ts +0 -30
- package/src/domain/organization-membership-lifecycle.ts +9 -0
- package/src/domain/packs.ts +106 -3
- package/src/domain/personal-connection-delegations.ts +597 -42
- package/src/domain/pr-review.ts +671 -0
- package/src/domain/remember.ts +549 -0
- package/src/domain/resources.ts +144 -6
- package/src/domain/scheduled-tasks.ts +504 -77
- package/src/domain/session-tool-policy.ts +12 -9
- package/src/domain/sessions.ts +629 -176
- package/src/editable-artifact-live/application.ts +21 -3
- package/src/editable-artifact-live/ports.ts +0 -1
- package/src/editable-artifact-live/server.ts +13 -7
- package/src/editable-artifact-live/ticket.ts +1 -5
- package/src/editable-artifact-live/types.ts +6 -2
- package/src/editable-artifact-live/wire.ts +0 -10
- package/src/index.ts +13 -1
- package/src/rigs/index.ts +165 -48
- package/src/sandbox/fleet.ts +376 -30
- package/src/sandbox/routing.ts +91 -29
- package/src/sandbox/runtime-settings.ts +274 -0
- package/src/session-authorization.ts +17 -49
- package/dist/chunk-6WKPWE5S.js.map +0 -1
- package/dist/chunk-JJU6I5XD.js.map +0 -1
- package/dist/chunk-NYPMQ7NO.js.map +0 -1
- package/dist/domain/durable-learning-slack-publication.d.ts +0 -72
- package/src/domain/durable-learning-slack-publication.ts +0 -202
package/src/domain/packs.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { createHash } from "node:crypto";
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
CapabilityPack,
|
|
5
|
+
OPENGENI_PR_REVIEW_PACK_ID,
|
|
6
|
+
OPENGENI_PR_REVIEW_SESSION_ROLE,
|
|
5
7
|
stableJson,
|
|
6
8
|
type CapabilityPackSkill,
|
|
7
9
|
type PackComponentResolution,
|
|
@@ -23,6 +25,12 @@ import {
|
|
|
23
25
|
} from "@opengeni/db";
|
|
24
26
|
import { buildPortableSkillArtifact } from "@opengeni/runtime/skill-library";
|
|
25
27
|
import { HTTPException } from "hono/http-exception";
|
|
28
|
+
import {
|
|
29
|
+
OPENGENI_PR_REVIEW_AGENT_INSTRUCTIONS,
|
|
30
|
+
OPENGENI_PR_REVIEW_SKILL,
|
|
31
|
+
PR_REVIEW_AUTOMATION_ADAPTER_ID,
|
|
32
|
+
PR_REVIEW_AUTOMATION_TEMPLATE_ID,
|
|
33
|
+
} from "./pr-review";
|
|
26
34
|
|
|
27
35
|
export const MARKETING_SOCIAL_PACK_ID = "marketing-social-daily-analysis";
|
|
28
36
|
|
|
@@ -39,6 +47,7 @@ const marketingSocialPack: CapabilityPack = {
|
|
|
39
47
|
// (see apps/worker/src/activities/packs.ts), and a test enforces this.
|
|
40
48
|
skills: [],
|
|
41
49
|
components: [],
|
|
50
|
+
automationTemplates: [],
|
|
42
51
|
tools: [
|
|
43
52
|
{ kind: "mcp", id: "opengeni" },
|
|
44
53
|
{ kind: "mcp", id: "docs" },
|
|
@@ -176,7 +185,99 @@ const marketingSocialPack: CapabilityPack = {
|
|
|
176
185
|
},
|
|
177
186
|
};
|
|
178
187
|
|
|
179
|
-
const
|
|
188
|
+
const openGeniPrReviewPack: CapabilityPack = {
|
|
189
|
+
id: OPENGENI_PR_REVIEW_PACK_ID,
|
|
190
|
+
name: "OpenGeni Review Bot",
|
|
191
|
+
description:
|
|
192
|
+
"Run provider-neutral, exact-head pull-request reviews from GitHub, GitLab, or Azure DevOps webhooks.",
|
|
193
|
+
role: "software-engineering",
|
|
194
|
+
category: "code-review",
|
|
195
|
+
version: "0.2.0",
|
|
196
|
+
skills: [OPENGENI_PR_REVIEW_SKILL],
|
|
197
|
+
components: [],
|
|
198
|
+
tools: [],
|
|
199
|
+
connectors: [
|
|
200
|
+
{
|
|
201
|
+
id: "github",
|
|
202
|
+
name: "GitHub App",
|
|
203
|
+
category: "source-control",
|
|
204
|
+
authModel: "credential_ref",
|
|
205
|
+
providers: ["github"],
|
|
206
|
+
scopes: ["metadata:read", "contents:read", "pull_requests:write"],
|
|
207
|
+
required: false,
|
|
208
|
+
metadata: {
|
|
209
|
+
oneOf: "source-control-provider",
|
|
210
|
+
setupPath: "/pr-review/registrations",
|
|
211
|
+
webhookEvents: ["pull_request"],
|
|
212
|
+
credentialMode: "short_lived_installation_token",
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
id: "gitlab",
|
|
217
|
+
name: "GitLab project token",
|
|
218
|
+
category: "source-control",
|
|
219
|
+
authModel: "credential_ref",
|
|
220
|
+
providers: ["gitlab"],
|
|
221
|
+
scopes: ["api", "read_repository"],
|
|
222
|
+
required: false,
|
|
223
|
+
metadata: {
|
|
224
|
+
oneOf: "source-control-provider",
|
|
225
|
+
setupPath: "/pr-review/registrations",
|
|
226
|
+
webhookEvents: ["Merge Request Hook"],
|
|
227
|
+
credentialMode: "provider_token",
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
id: "azure-devops",
|
|
232
|
+
name: "Azure DevOps identity token",
|
|
233
|
+
category: "source-control",
|
|
234
|
+
authModel: "credential_ref",
|
|
235
|
+
providers: ["azure_devops"],
|
|
236
|
+
scopes: ["vso.code", "vso.threads_full"],
|
|
237
|
+
required: false,
|
|
238
|
+
metadata: {
|
|
239
|
+
oneOf: "source-control-provider",
|
|
240
|
+
setupPath: "/pr-review/registrations",
|
|
241
|
+
webhookEvents: ["git.pullrequest.created", "git.pullrequest.updated"],
|
|
242
|
+
credentialMode: "provider_token",
|
|
243
|
+
},
|
|
244
|
+
},
|
|
245
|
+
],
|
|
246
|
+
knowledge: [],
|
|
247
|
+
scheduledTaskTemplates: [],
|
|
248
|
+
automationTemplates: [
|
|
249
|
+
{
|
|
250
|
+
id: PR_REVIEW_AUTOMATION_TEMPLATE_ID,
|
|
251
|
+
name: "Review pull requests",
|
|
252
|
+
description: "Start one exact-head review session for each accepted pull-request revision.",
|
|
253
|
+
adapterId: PR_REVIEW_AUTOMATION_ADAPTER_ID,
|
|
254
|
+
eventTypes: ["pull_request.review_requested"],
|
|
255
|
+
configuration: {},
|
|
256
|
+
connectionRequirement: "source-control-provider",
|
|
257
|
+
sessionTemplate: {
|
|
258
|
+
prompt: "Review the accepted pull-request revision and publish actionable findings.",
|
|
259
|
+
instructions: OPENGENI_PR_REVIEW_AGENT_INSTRUCTIONS,
|
|
260
|
+
resources: [],
|
|
261
|
+
skills: [OPENGENI_PR_REVIEW_SKILL],
|
|
262
|
+
tools: [],
|
|
263
|
+
firstPartyMcpTools: [],
|
|
264
|
+
firstPartyMcpPermissions: [],
|
|
265
|
+
model: null,
|
|
266
|
+
reasoningEffort: null,
|
|
267
|
+
sandboxBackend: null,
|
|
268
|
+
policyRole: OPENGENI_PR_REVIEW_SESSION_ROLE,
|
|
269
|
+
metadata: { role: OPENGENI_PR_REVIEW_SESSION_ROLE },
|
|
270
|
+
},
|
|
271
|
+
},
|
|
272
|
+
],
|
|
273
|
+
metadata: {
|
|
274
|
+
automation: "pull_request_review",
|
|
275
|
+
providers: ["github", "gitlab", "azure_devops"],
|
|
276
|
+
sessionRole: "pull_request_review",
|
|
277
|
+
},
|
|
278
|
+
};
|
|
279
|
+
|
|
280
|
+
const packs = [marketingSocialPack, openGeniPrReviewPack] satisfies CapabilityPack[];
|
|
180
281
|
|
|
181
282
|
export function listCapabilityPacks(): CapabilityPack[] {
|
|
182
283
|
return packs;
|
|
@@ -237,6 +338,7 @@ export function capabilityPackRequiresInstallationPlan(pack: CapabilityPack): bo
|
|
|
237
338
|
return (
|
|
238
339
|
pack.components.length > 0 ||
|
|
239
340
|
pack.skills.length > 0 ||
|
|
341
|
+
(pack.automationTemplates?.length ?? 0) > 0 ||
|
|
240
342
|
pack.rig !== undefined ||
|
|
241
343
|
pack.sandboxImage !== undefined ||
|
|
242
344
|
pack.sandboxProviderImages !== undefined
|
|
@@ -296,10 +398,11 @@ export function inlinePackSkillInstall(
|
|
|
296
398
|
|
|
297
399
|
export async function previewCapabilityPackInstallation(
|
|
298
400
|
db: Database,
|
|
299
|
-
workspaceId: string,
|
|
401
|
+
access: { accountId: string; workspaceId: string; subjectId: string },
|
|
300
402
|
pack: CapabilityPack,
|
|
301
403
|
options: { rigId?: string; variableSetId?: string } = {},
|
|
302
404
|
): Promise<PackInstallationPreview> {
|
|
405
|
+
const { workspaceId } = access;
|
|
303
406
|
const installation = await getPackInstallation(db, workspaceId, pack.id);
|
|
304
407
|
const inlineInstalls = pack.skills.map((skill) => inlinePackSkillInstall(pack, skill));
|
|
305
408
|
const [referencedComponents, inlineComponents] = await Promise.all([
|
|
@@ -344,7 +447,7 @@ export async function previewCapabilityPackInstallation(
|
|
|
344
447
|
if (pack.variableSet?.required && !variableSetId) {
|
|
345
448
|
blockers.push("Choose saved configuration before installing this Pack");
|
|
346
449
|
} else if (variableSetId) {
|
|
347
|
-
const variableSet = await getVariableSet(db,
|
|
450
|
+
const variableSet = await getVariableSet(db, access, variableSetId);
|
|
348
451
|
if (!variableSet) {
|
|
349
452
|
blockers.push("The selected configuration no longer exists in this workspace");
|
|
350
453
|
} else {
|