@opengeni/api-router 2.10.0-canary.2 → 2.10.0-canary.3

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/index.js CHANGED
@@ -7,7 +7,7 @@ import {
7
7
  createOpenGeniSlackBotInteractionClient,
8
8
  startSlackInteractionPump,
9
9
  startTemporalScheduleCleanupPump
10
- } from "./chunk-BVX5ASFY.js";
10
+ } from "./chunk-CZGPIPDA.js";
11
11
 
12
12
  // src/index.ts
13
13
  import {
@@ -82,8 +82,8 @@ export declare function scheduledTaskMcpSummary(task: ScheduledTask): {
82
82
  runMode: "existing_session" | "new_session_per_run" | "reusable_session";
83
83
  overlapPolicy: "allow_concurrent" | "buffer_one" | "skip";
84
84
  action: {
85
- readonly sourceId?: never;
86
85
  kind: "agent_turn";
86
+ sourceId?: never;
87
87
  sourceGeneration?: never;
88
88
  sourceLifecycleGeneration?: never;
89
89
  destination?: never;
@@ -205,8 +205,8 @@ export declare function boundScheduledTaskDetailMcp(task: ScheduledTask): {
205
205
  runMode: "existing_session" | "new_session_per_run" | "reusable_session";
206
206
  overlapPolicy: "allow_concurrent" | "buffer_one" | "skip";
207
207
  action: {
208
- readonly sourceId?: never;
209
208
  kind: "agent_turn";
209
+ sourceId?: never;
210
210
  sourceGeneration?: never;
211
211
  sourceLifecycleGeneration?: never;
212
212
  destination?: never;
@@ -389,8 +389,8 @@ export declare function boundScheduledTaskMcpPage(input: {
389
389
  runMode: "existing_session" | "new_session_per_run" | "reusable_session";
390
390
  overlapPolicy: "allow_concurrent" | "buffer_one" | "skip";
391
391
  action: {
392
- readonly sourceId?: never;
393
392
  kind: "agent_turn";
393
+ sourceId?: never;
394
394
  sourceGeneration?: never;
395
395
  sourceLifecycleGeneration?: never;
396
396
  destination?: never;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeni/api-router",
3
- "version": "2.10.0-canary.2",
3
+ "version": "2.10.0-canary.3",
4
4
  "description": "OpenGeni HTTP surface: the Hono adapter/router (createApp), routes, MCP HTTP transport, and HTTP access adapters over @opengeni/core. An engine-distribution surface — its runtime closure includes engine-internal packages.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -43,24 +43,24 @@
43
43
  "@hono/zod-validator": "^0.7.6",
44
44
  "@llamaindex/liteparse": "2.14.2",
45
45
  "@modelcontextprotocol/sdk": "^1.29.0",
46
- "@opengeni/agent-proto": "^0.5.1-canary.11",
47
- "@opengeni/artifact-tool": "^0.3.19-canary.2",
48
- "@opengeni/capabilities": "^0.3.2-canary.2",
49
- "@opengeni/codemode": "^0.4.27-canary.2",
50
- "@opengeni/codex": "^0.2.21-canary.2",
51
- "@opengeni/config": "^1.0.0-canary.2",
52
- "@opengeni/contracts": "^2.13.0-canary.2",
53
- "@opengeni/core": "^2.7.5-canary.2",
54
- "@opengeni/db": "^4.0.0-canary.2",
55
- "@opengeni/documents": "^0.8.19-canary.2",
56
- "@opengeni/events": "^0.4.17-canary.2",
57
- "@opengeni/github": "^0.7.3-canary.2",
58
- "@opengeni/network": "^0.3.0-canary.2",
59
- "@opengeni/observability": "^0.8.19-canary.2",
60
- "@opengeni/runtime": "^2.3.0-canary.2",
61
- "@opengeni/storage": "^0.2.120-canary.2",
62
- "@opengeni/tool-gateway": "^0.1.0-canary.2",
63
- "@opengeni/xai-subscription": "^0.1.3-canary.2",
46
+ "@opengeni/agent-proto": "^0.5.1-canary.12",
47
+ "@opengeni/artifact-tool": "^0.3.19-canary.3",
48
+ "@opengeni/capabilities": "^0.3.2-canary.3",
49
+ "@opengeni/codemode": "^0.4.27-canary.3",
50
+ "@opengeni/codex": "^0.2.21-canary.3",
51
+ "@opengeni/config": "^1.0.0-canary.3",
52
+ "@opengeni/contracts": "^2.13.0-canary.3",
53
+ "@opengeni/core": "^2.7.5-canary.3",
54
+ "@opengeni/db": "^4.0.0-canary.3",
55
+ "@opengeni/documents": "^0.8.19-canary.3",
56
+ "@opengeni/events": "^0.4.17-canary.3",
57
+ "@opengeni/github": "^0.7.3-canary.3",
58
+ "@opengeni/network": "^0.3.0-canary.3",
59
+ "@opengeni/observability": "^0.8.19-canary.3",
60
+ "@opengeni/runtime": "^2.3.0-canary.3",
61
+ "@opengeni/storage": "^0.2.120-canary.3",
62
+ "@opengeni/tool-gateway": "^0.1.0-canary.3",
63
+ "@opengeni/xai-subscription": "^0.1.3-canary.3",
64
64
  "@temporalio/client": "^1.17.0",
65
65
  "better-auth": "^1.6.14",
66
66
  "hono": "^4.12.18",
package/src/app.ts CHANGED
@@ -1974,6 +1974,10 @@ const routeLabelPatterns: Array<{
1974
1974
  pattern: /^\/v1\/workspaces\/[^/]+\/inference-control$/,
1975
1975
  label: "/v1/workspaces/:workspaceId/inference-control",
1976
1976
  },
1977
+ {
1978
+ pattern: /^\/v1\/workspaces\/[^/]+\/pause-timer$/,
1979
+ label: "/v1/workspaces/:workspaceId/pause-timer",
1980
+ },
1977
1981
  {
1978
1982
  pattern:
1979
1983
  /^\/v1\/workspaces\/[^/]+\/sessions\/[^/]+\/fs\/(list|list-batch|read|write|delete|move|mkdir)$/,
@@ -1,3 +1,5 @@
1
+ import { SessionControlConflictError, WorkspacePauseTimerInputError } from "@opengeni/db";
2
+ import { WorkspacePauseTimerRequest } from "@opengeni/contracts";
1
3
  import { createHash } from "node:crypto";
2
4
  import {
3
5
  AddWorkspaceMemberRequest,
@@ -95,6 +97,7 @@ import {
95
97
  assertWorkspaceMemberRemovable,
96
98
  assertWorkspaceMemberUpdateAllowed,
97
99
  controlHumanWorkspace,
100
+ controlHumanWorkspaceTimer,
98
101
  } from "@opengeni/core";
99
102
  import { boundedLimit } from "../http/common";
100
103
  import { ApiHttpError } from "../http/api-error";
@@ -824,6 +827,39 @@ export function registerWorkspaceRoutes(app: Hono, deps: ApiRouteDeps): void {
824
827
  return c.json(policy);
825
828
  });
826
829
 
830
+ app.post("/v1/workspaces/:workspaceId/pause-timer", async (c) => {
831
+ const workspaceId = c.req.param("workspaceId");
832
+ const grant = await requireAccessGrant(c, deps, workspaceId, "workspace:admin");
833
+ if (workspaceControlUtf8Bytes(grant.subjectId) > WORKSPACE_CONTROL_ACTOR_MAX_BYTES) {
834
+ throw new HTTPException(400, { message: "workspace-control actor is too large" });
835
+ }
836
+ const parsed = WorkspacePauseTimerRequest.safeParse(await c.req.json().catch(() => null));
837
+ if (!parsed.success) throw new HTTPException(400, { message: "Invalid pause timer" });
838
+ try {
839
+ await controlHumanWorkspaceTimer(
840
+ {
841
+ db: deps.db,
842
+ bus: deps.bus,
843
+ workflowClient: deps.workflowClient,
844
+ ...(deps.schedulePromptPostCommit
845
+ ? { schedulePromptPostCommit: deps.schedulePromptPostCommit }
846
+ : {}),
847
+ },
848
+ { accountId: grant.accountId, workspaceId, subjectId: grant.subjectId },
849
+ parsed.data,
850
+ );
851
+ } catch (error) {
852
+ if (error instanceof SessionControlConflictError)
853
+ throw new HTTPException(409, {
854
+ message: "Workspace changed. Reopen the timer and try again.",
855
+ });
856
+ if (error instanceof WorkspacePauseTimerInputError)
857
+ throw new HTTPException(400, { message: error.message });
858
+ throw error;
859
+ }
860
+ return c.json({ ok: true });
861
+ });
862
+
827
863
  app.post("/v1/workspaces/:workspaceId/inference-control", async (c) => {
828
864
  const workspaceId = c.req.param("workspaceId");
829
865
  const grant = await requireAccessGrant(c, deps, workspaceId, "workspace:admin");