@opengeni/core 0.28.0 → 1.0.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/README.md +1 -1
- package/dist/access/external-actor-authority.d.ts +47 -0
- package/dist/access/index.d.ts +182 -3
- package/dist/access/service-initiator.d.ts +3 -0
- package/dist/application/api-integration-servers.d.ts +20 -0
- package/dist/application/archived-session-imports.d.ts +6 -0
- package/dist/application/composer-submit.d.ts +24 -0
- package/dist/application/connect-authority.d.ts +13 -0
- package/dist/application/connect-operation.d.ts +31 -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 +34 -0
- package/dist/application/modal-native-worker-host-transport.d.ts +297 -0
- package/dist/application/new-session-drafts.d.ts +39 -2
- package/dist/application/sandbox-recovery.d.ts +58 -0
- package/dist/application/session-commands.d.ts +26 -13
- package/dist/application/session-mcp-credential-rotation.d.ts +29 -0
- package/dist/application/session-tenancy.d.ts +19 -0
- package/dist/application/user-resource-grants.d.ts +20 -0
- package/dist/billing/limits.d.ts +11 -0
- 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-6WKPWE5S.js → chunk-2MKMRGSY.js} +108 -24
- package/dist/chunk-2MKMRGSY.js.map +1 -0
- package/dist/{chunk-NYPMQ7NO.js → chunk-GVO3N37G.js} +205 -37
- package/dist/chunk-GVO3N37G.js.map +1 -0
- package/dist/{chunk-JJU6I5XD.js → chunk-LCQXNR62.js} +36 -10
- package/dist/chunk-LCQXNR62.js.map +1 -0
- package/dist/chunk-MM6N7CTO.js +387 -0
- package/dist/chunk-MM6N7CTO.js.map +1 -0
- package/dist/chunk-QO5GVFFO.js +235 -0
- package/dist/chunk-QO5GVFFO.js.map +1 -0
- package/dist/codex-model-availability.d.ts +14 -0
- package/dist/default-session-model.d.ts +139 -0
- package/dist/dependencies.d.ts +87 -4
- package/dist/developer-setup-credential-ceiling.d.ts +10 -0
- package/dist/domain/agent-config-resolution.d.ts +49 -0
- package/dist/domain/automations.d.ts +58 -0
- package/dist/domain/capabilities.d.ts +22 -4
- package/dist/domain/company-profile-agent-admin.d.ts +25 -0
- package/dist/domain/connection-account-selection-error.d.ts +8 -0
- package/dist/domain/connector-tool-permissions.d.ts +36 -0
- package/dist/domain/direct-model-provider.d.ts +3 -0
- package/dist/domain/editable-artifacts/agent-application.d.ts +10 -1
- package/dist/domain/editable-artifacts/durable-export.d.ts +22 -1
- package/dist/domain/editable-artifacts/ports.d.ts +10 -0
- package/dist/domain/editable-artifacts/service.d.ts +4 -3
- package/dist/domain/environments.d.ts +5 -9
- package/dist/domain/external-creation-attribution.d.ts +6 -0
- package/dist/domain/file-owner.d.ts +8 -0
- package/dist/domain/github-action-policies.d.ts +36 -0
- package/dist/domain/github-repository-bindings.d.ts +117 -0
- package/dist/domain/github-skill-source.d.ts +5 -0
- package/dist/domain/governed-learning-slack-publication.d.ts +45 -0
- package/dist/domain/insights-timing.d.ts +16 -0
- package/dist/domain/insights-usage.d.ts +27 -0
- package/dist/domain/insights.d.ts +28 -1
- package/dist/domain/knowledge-files.d.ts +20 -0
- package/dist/domain/knowledge-messages.d.ts +39 -0
- package/dist/domain/knowledge-messages.test.d.ts +1 -0
- package/dist/domain/knowledge-preparation.d.ts +10 -0
- package/dist/domain/knowledge-preparation.test.d.ts +1 -0
- package/dist/domain/knowledge-search.d.ts +15 -0
- package/dist/domain/knowledge-search.test.d.ts +1 -0
- package/dist/domain/knowledge.d.ts +9 -0
- package/dist/domain/mcp-account-bindings.d.ts +19 -0
- package/dist/domain/mcp-account-routes.d.ts +21 -0
- package/dist/domain/native-mcp-connection-admission.d.ts +3 -0
- package/dist/domain/organization-integration-catalog.d.ts +15 -0
- package/dist/domain/organization-membership-lifecycle.d.ts +1 -0
- package/dist/domain/personal-connection-delegations.d.ts +87 -4
- package/dist/domain/pr-review.d.ts +249 -0
- package/dist/domain/resources.d.ts +24 -3
- package/dist/domain/scheduled-task-access.d.ts +247 -0
- package/dist/domain/scheduled-tasks.d.ts +103 -6
- package/dist/domain/session-connection-accounts.d.ts +16 -0
- package/dist/domain/session-file-access.d.ts +4 -0
- package/dist/domain/session-native-connection-replacement.d.ts +14 -0
- package/dist/domain/session-start-timing.d.ts +7 -0
- package/dist/domain/session-tool-policy.d.ts +93 -4
- package/dist/domain/sessions.d.ts +275 -28
- package/dist/domain/skill-imports.d.ts +1 -0
- package/dist/domain/skill-search.d.ts +30 -0
- package/dist/domain/skills.d.ts +117 -0
- package/dist/domain/slack-bot.d.ts +46 -1
- package/dist/domain/workspace-members.d.ts +8 -1
- package/dist/editable-artifact-live/application.d.ts +12 -3
- package/dist/editable-artifact-live/ports.d.ts +0 -1
- package/dist/editable-artifact-live/server.d.ts +5 -2
- package/dist/editable-artifact-live/ticket.d.ts +2 -2
- package/dist/editable-artifact-live/types.d.ts +14 -2
- package/dist/editable-artifact-live.js +2 -2
- package/dist/editable-artifacts.js +10 -4
- package/dist/index.d.ts +49 -3
- package/dist/index.js +18826 -6847
- package/dist/index.js.map +1 -1
- package/dist/managed-auth-session-sets.d.ts +131 -0
- package/dist/managed-auth-session-sets.js +51 -0
- package/dist/managed-auth-session-sets.js.map +1 -0
- package/dist/managed-session.d.ts +98 -11
- package/dist/model-catalog.d.ts +117 -0
- package/dist/product-usage-metrics.d.ts +30 -0
- package/dist/rigs/index.d.ts +22 -5
- package/dist/rigs/provider-images.d.ts +1 -1
- package/dist/sandbox/fleet.d.ts +59 -10
- package/dist/sandbox/routing.d.ts +22 -2
- package/dist/sandbox/runtime-settings.d.ts +56 -0
- package/dist/session-authorization.d.ts +38 -1
- package/dist/site-session-origin.d.ts +9 -0
- package/dist/transcription.d.ts +12 -1
- package/dist/turn-surface.d.ts +18 -0
- package/dist/user-presence.d.ts +32 -0
- package/package.json +18 -11
- package/src/access/external-actor-authority.ts +94 -0
- package/src/access/index.ts +1386 -44
- package/src/access/service-initiator.ts +50 -0
- package/src/application/api-integration-servers.ts +215 -0
- package/src/application/archived-session-imports.ts +161 -0
- package/src/application/composer-submit.ts +77 -0
- package/src/application/connect-authority.ts +77 -0
- package/src/application/connect-operation.ts +80 -0
- package/src/application/external-continuation.ts +129 -0
- package/src/application/external-identity-lifecycle.ts +48 -0
- package/src/application/external-link-work-admission.ts +90 -0
- package/src/application/external-workspace-members.ts +232 -0
- package/src/application/modal-native-worker-host-transport.ts +263 -0
- package/src/application/new-session-drafts.ts +222 -29
- package/src/application/sandbox-recovery.ts +78 -0
- package/src/application/session-commands.ts +430 -73
- package/src/application/session-mcp-credential-rotation.ts +217 -0
- package/src/application/session-tenancy.ts +445 -0
- package/src/application/user-resource-grants.ts +154 -0
- package/src/billing/limits.ts +103 -24
- package/src/canonical-human-identities.ts +22 -3
- package/src/codex-model-availability.ts +136 -0
- package/src/default-session-model.ts +656 -0
- package/src/dependencies.ts +97 -5
- package/src/developer-setup-credential-ceiling.ts +60 -0
- package/src/domain/agent-config-resolution.ts +148 -0
- package/src/domain/automations.ts +270 -0
- package/src/domain/capabilities.ts +244 -151
- package/src/domain/company-profile-agent-admin.ts +56 -0
- package/src/domain/connection-account-selection-error.ts +19 -0
- package/src/domain/connector-tool-permissions.ts +371 -0
- package/src/domain/direct-model-provider.ts +62 -0
- package/src/domain/editable-artifacts/agent-application.ts +61 -15
- package/src/domain/editable-artifacts/durable-export.ts +100 -5
- package/src/domain/editable-artifacts/in-memory.ts +6 -0
- package/src/domain/editable-artifacts/ports.ts +11 -0
- package/src/domain/editable-artifacts/service.ts +32 -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 +25 -45
- package/src/domain/external-creation-attribution.ts +22 -0
- package/src/domain/file-owner.ts +67 -0
- package/src/domain/github-action-policies.ts +169 -0
- package/src/domain/github-repository-bindings.ts +295 -0
- package/src/domain/github-skill-source.ts +233 -0
- package/src/domain/governed-learning-slack-publication.ts +157 -0
- package/src/domain/insights-timing.ts +95 -0
- package/src/domain/insights-usage.ts +67 -0
- package/src/domain/insights.ts +270 -169
- package/src/domain/knowledge-files.ts +46 -0
- package/src/domain/knowledge-messages.test.ts +91 -0
- package/src/domain/knowledge-messages.ts +106 -0
- package/src/domain/knowledge-preparation.test.ts +276 -0
- package/src/domain/knowledge-preparation.ts +147 -0
- package/src/domain/knowledge-search.test.ts +561 -0
- package/src/domain/knowledge-search.ts +256 -0
- package/src/domain/knowledge.ts +133 -0
- package/src/domain/mcp-account-bindings.ts +171 -0
- package/src/domain/mcp-account-routes.ts +121 -0
- package/src/domain/native-mcp-connection-admission.ts +14 -0
- package/src/domain/organization-integration-catalog.ts +88 -0
- package/src/domain/organization-membership-lifecycle.ts +10 -0
- package/src/domain/personal-connection-delegations.ts +758 -115
- package/src/domain/pr-review.ts +687 -0
- package/src/domain/resources.ts +182 -25
- package/src/domain/scheduled-task-access.ts +1052 -0
- package/src/domain/scheduled-tasks.ts +1952 -215
- package/src/domain/session-connection-accounts.ts +67 -0
- package/src/domain/session-file-access.ts +47 -0
- package/src/domain/session-native-connection-replacement.ts +64 -0
- package/src/domain/session-start-timing.ts +55 -0
- package/src/domain/session-tool-policy.ts +443 -19
- package/src/domain/sessions.ts +3417 -619
- package/src/domain/skill-imports.ts +137 -17
- package/src/domain/skill-search.ts +221 -0
- package/src/domain/skills.ts +104 -0
- package/src/domain/slack-bot.ts +128 -3
- package/src/domain/workspace-members.ts +34 -2
- package/src/editable-artifact-live/application.ts +29 -4
- package/src/editable-artifact-live/ports.ts +0 -1
- package/src/editable-artifact-live/server.ts +167 -13
- package/src/editable-artifact-live/ticket.ts +87 -6
- package/src/editable-artifact-live/types.ts +16 -2
- package/src/editable-artifact-live/wire.ts +0 -10
- package/src/index.ts +69 -4
- package/src/managed-auth-session-sets.ts +371 -0
- package/src/managed-session.ts +520 -2
- package/src/model-catalog.ts +873 -0
- package/src/product-usage-metrics.ts +101 -0
- package/src/rigs/index.ts +179 -63
- package/src/rigs/provider-images.ts +2 -3
- package/src/sandbox/fleet.ts +471 -59
- package/src/sandbox/routing.ts +160 -33
- package/src/sandbox/runtime-settings.ts +281 -0
- package/src/session-authorization.ts +262 -78
- package/src/site-session-origin.ts +22 -0
- package/src/transcription.ts +13 -1
- package/src/turn-surface.ts +45 -0
- package/src/user-presence.ts +134 -0
- package/dist/chunk-6WKPWE5S.js.map +0 -1
- package/dist/chunk-IBOEYG6N.js +0 -34
- package/dist/chunk-IBOEYG6N.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/dist/domain/packs.d.ts +0 -55
- package/src/domain/durable-learning-slack-publication.ts +0 -202
- package/src/domain/packs.ts +0 -556
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
enqueueMemorySlackPublication,
|
|
3
|
-
getCurrentMemorySlackPublicationConfiguration,
|
|
4
|
-
type Database,
|
|
5
|
-
type EnqueueMemorySlackPublicationResult,
|
|
6
|
-
} from "@opengeni/db";
|
|
7
|
-
import { sanitizeSlackPublicationText } from "./slack-publication-secret-safety";
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Narrow post-persistence port for the immutable durable-learning v1 attempt/receipt contract.
|
|
11
|
-
* The router owns validation, authority, routing, and persistence. This adapter
|
|
12
|
-
* consumes only the fields required to create a bounded notification projection.
|
|
13
|
-
*/
|
|
14
|
-
export type DurableLearningSlackOutcome = {
|
|
15
|
-
attempt: {
|
|
16
|
-
id: string;
|
|
17
|
-
accountId: string;
|
|
18
|
-
workspaceId: string;
|
|
19
|
-
inputHash: string;
|
|
20
|
-
actor: { kind: "human" | "agent" | "service"; subjectId: string };
|
|
21
|
-
initiatingHumanSubjectId: string | null;
|
|
22
|
-
sessionId: string | null;
|
|
23
|
-
request:
|
|
24
|
-
| {
|
|
25
|
-
operation: "write";
|
|
26
|
-
subject: {
|
|
27
|
-
kind: string;
|
|
28
|
-
summary: string | null;
|
|
29
|
-
};
|
|
30
|
-
evidence: Array<{ kind: string }>;
|
|
31
|
-
}
|
|
32
|
-
| {
|
|
33
|
-
operation: "rollback";
|
|
34
|
-
targetAttemptId: string;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
receipt: {
|
|
38
|
-
attemptId: string;
|
|
39
|
-
inputHash: string;
|
|
40
|
-
outcome:
|
|
41
|
-
| "applied"
|
|
42
|
-
| "proposed"
|
|
43
|
-
| "evidence_recorded"
|
|
44
|
-
| "noop"
|
|
45
|
-
| "clarification_required"
|
|
46
|
-
| "rejected"
|
|
47
|
-
| "rolled_back"
|
|
48
|
-
| "failed";
|
|
49
|
-
decision: {
|
|
50
|
-
code: string;
|
|
51
|
-
destination: string | null;
|
|
52
|
-
scope: { kind: string } | null;
|
|
53
|
-
authority: string | null;
|
|
54
|
-
};
|
|
55
|
-
resource: {
|
|
56
|
-
surface: string;
|
|
57
|
-
id: string;
|
|
58
|
-
version: string | null;
|
|
59
|
-
status: string;
|
|
60
|
-
} | null;
|
|
61
|
-
createdAt: string;
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
export type DurableLearningSlackPublicationResult =
|
|
66
|
-
| {
|
|
67
|
-
kind:
|
|
68
|
-
| "contract_mismatch"
|
|
69
|
-
| "not_workspace_scoped"
|
|
70
|
-
| "connector_evidence_untrusted"
|
|
71
|
-
| "summary_required"
|
|
72
|
-
| "policy_quiet";
|
|
73
|
-
enqueue: null;
|
|
74
|
-
}
|
|
75
|
-
| { kind: "enqueued"; enqueue: EnqueueMemorySlackPublicationResult };
|
|
76
|
-
|
|
77
|
-
export type DurableLearningSlackProjection = {
|
|
78
|
-
summary: string;
|
|
79
|
-
outcome: DurableLearningSlackOutcome["receipt"]["outcome"];
|
|
80
|
-
decisionCode: string;
|
|
81
|
-
destination: string | null;
|
|
82
|
-
authority: string | null;
|
|
83
|
-
resource: DurableLearningSlackOutcome["receipt"]["resource"];
|
|
84
|
-
occurredAt: string;
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
export async function publishDurableLearningOutcomeToSlack(
|
|
88
|
-
db: Database,
|
|
89
|
-
outcome: DurableLearningSlackOutcome,
|
|
90
|
-
): Promise<DurableLearningSlackPublicationResult> {
|
|
91
|
-
const { attempt, receipt } = outcome;
|
|
92
|
-
if (attempt.id !== receipt.attemptId || attempt.inputHash !== receipt.inputHash) {
|
|
93
|
-
return { kind: "contract_mismatch", enqueue: null };
|
|
94
|
-
}
|
|
95
|
-
if (receipt.decision.scope?.kind !== "workspace") {
|
|
96
|
-
return { kind: "not_workspace_scoped", enqueue: null };
|
|
97
|
-
}
|
|
98
|
-
if (
|
|
99
|
-
attempt.request.operation === "write" &&
|
|
100
|
-
attempt.request.evidence.some((evidence) => evidence.kind === "connector")
|
|
101
|
-
) {
|
|
102
|
-
// The v1 router contract intentionally does not identify connector providers.
|
|
103
|
-
// Fail closed rather than risk republishing a Slack-derived learning outcome.
|
|
104
|
-
return { kind: "connector_evidence_untrusted", enqueue: null };
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
const projection = durableLearningSlackProjection(outcome);
|
|
108
|
-
if (!projection) return { kind: "summary_required", enqueue: null };
|
|
109
|
-
const importance = durableLearningImportance(outcome);
|
|
110
|
-
const configuration = await getCurrentMemorySlackPublicationConfiguration(
|
|
111
|
-
db,
|
|
112
|
-
attempt.workspaceId,
|
|
113
|
-
);
|
|
114
|
-
const deliveryMode = configuration?.autoImportances.includes(importance)
|
|
115
|
-
? "auto"
|
|
116
|
-
: configuration?.reviewImportances.includes(importance)
|
|
117
|
-
? "review"
|
|
118
|
-
: null;
|
|
119
|
-
if (!configuration?.enabled || !deliveryMode) {
|
|
120
|
-
return { kind: "policy_quiet", enqueue: null };
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
const enqueue = await enqueueMemorySlackPublication(db, {
|
|
124
|
-
accountId: attempt.accountId,
|
|
125
|
-
workspaceId: attempt.workspaceId,
|
|
126
|
-
sourceType: "durable_learning",
|
|
127
|
-
sourceId: receipt.attemptId,
|
|
128
|
-
sourceVersion: receipt.inputHash,
|
|
129
|
-
sourceIdempotencyKey: `durable-learning:${receipt.attemptId}`,
|
|
130
|
-
projection,
|
|
131
|
-
importance,
|
|
132
|
-
deliveryMode,
|
|
133
|
-
actor: {
|
|
134
|
-
kind: attempt.actor.kind,
|
|
135
|
-
subjectId: attempt.actor.subjectId,
|
|
136
|
-
initiatingHumanSubjectId: attempt.initiatingHumanSubjectId,
|
|
137
|
-
sessionId: attempt.sessionId,
|
|
138
|
-
attemptId: attempt.id,
|
|
139
|
-
},
|
|
140
|
-
});
|
|
141
|
-
return { kind: "enqueued", enqueue };
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
export function durableLearningImportance(
|
|
145
|
-
outcome: DurableLearningSlackOutcome,
|
|
146
|
-
): "major" | "normal" | "minor" {
|
|
147
|
-
if (outcome.receipt.outcome === "failed" || outcome.receipt.outcome === "rolled_back") {
|
|
148
|
-
return "major";
|
|
149
|
-
}
|
|
150
|
-
if (outcome.receipt.outcome === "noop" || outcome.receipt.outcome === "clarification_required") {
|
|
151
|
-
return "minor";
|
|
152
|
-
}
|
|
153
|
-
if (
|
|
154
|
-
outcome.attempt.request.operation === "write" &&
|
|
155
|
-
["decision", "workspace_charter", "mandatory_operating_context", "workspace_goal"].includes(
|
|
156
|
-
outcome.attempt.request.subject.kind,
|
|
157
|
-
)
|
|
158
|
-
) {
|
|
159
|
-
return "major";
|
|
160
|
-
}
|
|
161
|
-
return "normal";
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
export function durableLearningSlackProjection(
|
|
165
|
-
outcome: DurableLearningSlackOutcome,
|
|
166
|
-
): DurableLearningSlackProjection | null {
|
|
167
|
-
const summary = durableLearningSummary(outcome);
|
|
168
|
-
if (!summary) return null;
|
|
169
|
-
return {
|
|
170
|
-
summary,
|
|
171
|
-
outcome: outcome.receipt.outcome,
|
|
172
|
-
decisionCode: outcome.receipt.decision.code,
|
|
173
|
-
destination: boundedSlackPublicationText(outcome.receipt.decision.destination, 128),
|
|
174
|
-
authority: outcome.receipt.decision.authority,
|
|
175
|
-
resource: outcome.receipt.resource
|
|
176
|
-
? {
|
|
177
|
-
surface: outcome.receipt.resource.surface,
|
|
178
|
-
id: outcome.receipt.resource.id,
|
|
179
|
-
version: outcome.receipt.resource.version,
|
|
180
|
-
status: outcome.receipt.resource.status,
|
|
181
|
-
}
|
|
182
|
-
: null,
|
|
183
|
-
occurredAt: outcome.receipt.createdAt,
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
function durableLearningSummary(outcome: DurableLearningSlackOutcome): string | null {
|
|
188
|
-
if (outcome.attempt.request.operation === "rollback") {
|
|
189
|
-
const destination =
|
|
190
|
-
boundedSlackPublicationText(outcome.receipt.decision.destination, 128) ??
|
|
191
|
-
"governed knowledge";
|
|
192
|
-
return `Rolled back a durable learning change for ${destination}.`;
|
|
193
|
-
}
|
|
194
|
-
const summary = outcome.attempt.request.subject.summary?.replace(/\s+/g, " ").trim();
|
|
195
|
-
return summary ? sanitizeSlackPublicationText(summary).slice(0, 512) : null;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
function boundedSlackPublicationText(value: string | null, maxChars: number): string | null {
|
|
199
|
-
if (!value) return null;
|
|
200
|
-
const sanitized = sanitizeSlackPublicationText(value.replace(/\s+/g, " ").trim());
|
|
201
|
-
return sanitized ? sanitized.slice(0, maxChars) : null;
|
|
202
|
-
}
|