@opengeni/api-router 4.1.2-canary.36079201993001 → 4.1.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/dist/app.js CHANGED
@@ -24,7 +24,7 @@ import {
24
24
  withDefaultEnabledCapabilityMcpTools,
25
25
  workflowIdForSession,
26
26
  workspaceActorContextExempt
27
- } from "./chunk-PTO4RZT5.js";
27
+ } from "./chunk-2SSU5KWV.js";
28
28
  export {
29
29
  API_MAX_REQUEST_BODY_BYTES,
30
30
  allowedCorsOrigin,
@@ -331,10 +331,6 @@ var FIRST_PARTY_TOOL_AUTHORIZATION = {
331
331
  sessionRequired: true,
332
332
  allOf: ["workspace:read"]
333
333
  },
334
- custom_mcp_setup_request: {
335
- sessionRequired: true,
336
- allOf: ["workspace:read"]
337
- },
338
334
  github_connect_link: { allOf: ["github:use"] },
339
335
  github_repositories_list: { allOf: ["github:use"] },
340
336
  social_connections_list: { allOf: ["connections:read"] },
@@ -27755,7 +27751,7 @@ function registerGoalTools(server, deps, grant, sessionId, json) {
27755
27751
  server.registerTool(
27756
27752
  "goal_update",
27757
27753
  {
27758
- description: "Maintain your operational goal as user direction or meaningful new evidence clarifies the intended outcome. Changes apply directly unless the user explicitly configured review_changes; refinement, adaptation, and replacement are audit classifications, not approval gates under the default policy. Use the exact expected objective revision and a concise rationale. Updating a goal grants no additional authority and cannot change root constraints. Use goal_progress for an execution-progress audit fact rather than a goal rewrite.",
27754
+ description: "Propose or apply a semantic goal revision under the session's mutation policy. Retain the standing goal unless explicit user direction or meaningful new evidence justifies the declared refinement, adaptation, or replacement. Every rewrite must use the exact expected objective revision and a concise rationale. Root constraints cannot be changed by an agent. A rewrite is not an execution-progress audit fact; use the optional goal_progress tool when such a fact should be recorded.",
27759
27755
  inputSchema: {
27760
27756
  text: goalText.optional(),
27761
27757
  successCriteria: successCriteriaSchema.nullable().optional(),
@@ -30687,60 +30683,6 @@ function registerCapabilityDiscoveryTools(server, deps, grant, sessionId, json)
30687
30683
  });
30688
30684
  }
30689
30685
  );
30690
- server.registerTool(
30691
- "custom_mcp_setup_request",
30692
- {
30693
- description: "Show a review card for a remote HTTPS MCP server that is not in the workspace catalog. Use only an endpoint supplied by the user or established by reliable documentation; do not invent a URL. Never include query parameters or secrets in this URL; the human can edit it in the protected setup form. The agent cannot add, enable, or contact the server. Search the catalog first and do not propose an already available integration.",
30694
- inputSchema: {
30695
- name: z43.string().trim().min(1).max(256),
30696
- endpointUrl: z43.string().url().max(2048).refine((url) => {
30697
- const parsed = new URL(url);
30698
- return parsed.protocol === "https:" && !parsed.username && !parsed.password && !parsed.hash && !parsed.search;
30699
- }),
30700
- rationale: z43.string().trim().min(1).max(2e3)
30701
- }
30702
- },
30703
- async ({ name, endpointUrl, rationale }) => {
30704
- await authorize();
30705
- const current = await catalog();
30706
- const existing = current.items.find(
30707
- (item) => item.kind === "mcp" && item.endpointUrl === endpointUrl && !item.stale
30708
- );
30709
- if (existing) {
30710
- return json({
30711
- status: "already_in_catalog",
30712
- capabilityId: existing.id,
30713
- message: "Use the catalog authorization flow for this server instead."
30714
- });
30715
- }
30716
- const claims = exactAgentCommandContext(grant, sessionId);
30717
- const payload = ToolAuthNeededPayload.parse({
30718
- serverId: "opengeni",
30719
- toolName: "custom_mcp_setup_request",
30720
- providerDomain: new URL(endpointUrl).hostname,
30721
- reason: "missing_connection",
30722
- setupRequest: { kind: "mcp", name, endpointUrl, rationale }
30723
- });
30724
- const appended = await appendAndPublishTurnEventsFenced(
30725
- deps.db,
30726
- deps.bus,
30727
- grant.workspaceId,
30728
- sessionId,
30729
- claims.callerTurnId,
30730
- claims.callerExecutionGeneration,
30731
- claims.callerAttemptId,
30732
- [{ type: "tool.auth_needed", payload }]
30733
- );
30734
- if (!appended.accepted) {
30735
- throw new Error("The calling turn was replaced before the setup request committed.");
30736
- }
30737
- return json({
30738
- status: "setup_requested",
30739
- eventId: appended.events[0]?.id ?? null,
30740
- message: "The human review card was posted. No server was added or contacted."
30741
- });
30742
- }
30743
- );
30744
30686
  }
30745
30687
  async function capabilitySetupProjection(deps, workspaceId, item, availableServerIds, acceptedServerIds, accountSelectionKnown, availableFirstPartyTools, selectedFirstPartyTools) {
30746
30688
  if (item.surfaceType === "first_party_fiken") {
@@ -70671,7 +70613,6 @@ import {
70671
70613
  dispatchExternalAuth,
70672
70614
  dispatchProtectedAuthFill,
70673
70615
  failBrowserSessionOperation,
70674
- failPreparedBrowserSessionEnd,
70675
70616
  failPreparedBrowserSessionSuspend,
70676
70617
  failBrowserSessionResume,
70677
70618
  failBrowserSessionResumePreparation,
@@ -74123,7 +74064,6 @@ function registerBrowserSessionRoutes(app, deps) {
74123
74064
  const request = await parseJsonBody2(context, BrowserSessionLifecycleRequest);
74124
74065
  const startedAtMs = performance.now();
74125
74066
  const origin = requestOrigin(context, deps.settings);
74126
- let endPreparation = null;
74127
74067
  try {
74128
74068
  const before = await getBrowserSessionControlRecord(deps.db, {
74129
74069
  accountId: grant.accountId,
@@ -74137,10 +74077,7 @@ function registerBrowserSessionRoutes(app, deps) {
74137
74077
  workspaceId,
74138
74078
  browserSessionId,
74139
74079
  operationId: request.operationId,
74140
- actorSubjectId: grant.subjectId,
74141
- expectedLifecycle: before.session.lifecycle,
74142
- expectedFailureCode: before.session.failureCode,
74143
- expectedControllerGeneration: before.session.controller?.controllerGeneration ?? null
74080
+ actorSubjectId: grant.subjectId
74144
74081
  });
74145
74082
  if (isTerminalOperation(prepared.operation.state)) {
74146
74083
  if (prepared.operation.state === "completed") {
@@ -74156,13 +74093,6 @@ function registerBrowserSessionRoutes(app, deps) {
74156
74093
  observeLifecycleResult(deps.observability, startedAtMs, parsed2);
74157
74094
  return context.json(parsed2, 200);
74158
74095
  }
74159
- if (before.session.lifecycle !== "ending") {
74160
- endPreparation = {
74161
- restoreLifecycle: before.session.lifecycle,
74162
- restoreFailureCode: before.session.failureCode,
74163
- expectedControllerGeneration: before.session.controller?.controllerGeneration ?? null
74164
- };
74165
- }
74166
74096
  const record6 = await getBrowserSessionControlRecord(deps.db, {
74167
74097
  accountId: grant.accountId,
74168
74098
  workspaceId,
@@ -74252,16 +74182,6 @@ function registerBrowserSessionRoutes(app, deps) {
74252
74182
  observeLifecycleResult(deps.observability, startedAtMs, parsed);
74253
74183
  return context.json(parsed, 200);
74254
74184
  } catch (error) {
74255
- if (endPreparation) {
74256
- await failPreparedBrowserSessionEnd(deps.db, {
74257
- accountId: grant.accountId,
74258
- workspaceId,
74259
- browserSessionId,
74260
- operationId: request.operationId,
74261
- ...endPreparation,
74262
- error: interactionFailure(error)
74263
- });
74264
- }
74265
74185
  throw browserRouteError(error);
74266
74186
  }
74267
74187
  }
@@ -75303,7 +75223,6 @@ async function settleBrowserSessionSuspensionCaptureFailure(deps, input, error)
75303
75223
  return await failBrowserSessionSuspension(deps.db, {
75304
75224
  ...input,
75305
75225
  ...outcomeUnknown ? { state: "outcome_unknown" } : {},
75306
- missingControllerSession: error.status === 404 && isMissingBrowserControllerSession(error),
75307
75226
  error: error.error
75308
75227
  });
75309
75228
  }
@@ -107630,4 +107549,4 @@ export {
107630
107549
  withDefaultEnabledCapabilityMcpTools,
107631
107550
  workflowIdForSession4 as workflowIdForSession
107632
107551
  };
107633
- //# sourceMappingURL=chunk-PTO4RZT5.js.map
107552
+ //# sourceMappingURL=chunk-2SSU5KWV.js.map