@opengeni/api-router 2.1.0-canary.0 → 2.2.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/index.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  createOpenGeniSlackBotInteractionClient,
7
7
  startSlackInteractionPump,
8
8
  startTemporalScheduleCleanupPump
9
- } from "./chunk-QKDFBBUE.js";
9
+ } from "./chunk-3TP54PPX.js";
10
10
 
11
11
  // src/index.ts
12
12
  import {
@@ -75,6 +75,14 @@ export type SlackMessageBlock = {
75
75
  };
76
76
  style?: "primary" | "danger";
77
77
  }>;
78
+ } | {
79
+ type: "context";
80
+ block_id?: string;
81
+ elements: Array<{
82
+ type: "mrkdwn" | "plain_text";
83
+ text: string;
84
+ emoji?: boolean;
85
+ }>;
78
86
  } | {
79
87
  type: "divider";
80
88
  };
@@ -1,8 +1,8 @@
1
1
  import { type FileResourceRef, type WorkspaceSlackReactionSummonSettings } from "@opengeni/contracts";
2
- import { type SlackInstallationRoute, type SlackInteractionInboxEntry, type SlackInteractionTriggerKind } from "@opengeni/db";
2
+ import { type SlackInstallationRoute, type SlackInteraction, type SlackInteractionInboxEntry, type SlackInteractionTriggerKind } from "@opengeni/db";
3
3
  import { type ApiRouteDeps } from "@opengeni/core";
4
4
  import type { Hono } from "hono";
5
- import { type OpenGeniSlackBotClient } from "./slack-bot.js";
5
+ import { type OpenGeniSlackBotClient, type SlackMessageBlock } from "./slack-bot.js";
6
6
  import { type ImportedSlackReactionImage } from "../slack-reaction-files.js";
7
7
  export declare const SLACK_INTERACTION_MAX_BODY_BYTES: number;
8
8
  export declare const SLACK_SIGNATURE_REPLAY_WINDOW_SECONDS = 300;
@@ -53,6 +53,39 @@ export declare function startSlackInteractionPump(deps: ApiRouteDeps, options?:
53
53
  intervalMs?: number;
54
54
  maxPerTick?: number;
55
55
  }): () => void;
56
+ /**
57
+ * Say where the work went, quietly.
58
+ *
59
+ * The line exists to stop work landing somewhere surprising, so it appears only
60
+ * when the routing decision was a genuine choice: a null label means routing is
61
+ * off, or the person had exactly one workspace anyway, and a constant footer on
62
+ * every message would be noise rather than information.
63
+ *
64
+ * The label is frozen on the interaction rather than looked up here, because a
65
+ * workspace rename between the original post and a reconciliation would make the
66
+ * post ledger's byte comparison raise.
67
+ */
68
+ export declare function withWorkspaceLine(label: string | null, text: string, blocks?: SlackMessageBlock[]): {
69
+ text: string;
70
+ blocks?: SlackMessageBlock[];
71
+ };
72
+ /**
73
+ * The post-ledger seed for one interaction's messages.
74
+ *
75
+ * The ledger binds one operation id to a digest over the rendered bytes, so
76
+ * adding the workspace line under an unchanged id would wedge every interaction
77
+ * with a claimed-but-unposted row. But bumping the id for interactions whose
78
+ * bytes did NOT change is not free either: their ledger rows become unreachable,
79
+ * so a repair or a cross-deploy retry posts a duplicate instead of finding the
80
+ * completed original, and an action handle still points at the old operation.
81
+ *
82
+ * Only a labelled interaction renders different bytes, and the label is written
83
+ * once at insert and never updated, so it is a stable discriminator. Version the
84
+ * id on the label rather than on the release: a labelled interaction can only
85
+ * have been created by an image that already renders the line, and every
86
+ * pre-existing and unlabelled interaction keeps its exact ledger identity.
87
+ */
88
+ export declare function slackPostSeed(interaction: Pick<SlackInteraction, "routedWorkspaceLabel">, seed: string): string;
56
89
  export type SlackInvocationMessageContext = {
57
90
  messages: Awaited<ReturnType<OpenGeniSlackBotClient["threadReplies"]>>["messages"];
58
91
  nextCursor: string | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeni/api-router",
3
- "version": "2.1.0-canary.0",
3
+ "version": "2.2.0-canary.0",
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,23 +43,23 @@
43
43
  "@hono/zod-validator": "^0.7.6",
44
44
  "@llamaindex/liteparse": "^1.5.3",
45
45
  "@modelcontextprotocol/sdk": "^1.29.0",
46
- "@opengeni/agent-proto": "^0.5.1-canary.0",
47
- "@opengeni/artifact-tool": "^0.3.4-canary.0",
48
- "@opengeni/capabilities": "^0.3.0-canary.0",
49
- "@opengeni/codemode": "^0.4.12-canary.0",
50
- "@opengeni/codex": "^0.2.18-canary.0",
51
- "@opengeni/config": "^0.19.0-canary.0",
52
- "@opengeni/contracts": "^2.2.0-canary.0",
53
- "@opengeni/core": "^2.1.0-canary.0",
54
- "@opengeni/db": "^3.1.0-canary.0",
55
- "@opengeni/documents": "^0.6.9-canary.0",
56
- "@opengeni/events": "^0.3.123-canary.0",
57
- "@opengeni/github": "^0.5.2-canary.0",
58
- "@opengeni/network": "^0.2.2-canary.0",
59
- "@opengeni/observability": "^0.8.3-canary.0",
60
- "@opengeni/runtime": "^1.3.0-canary.0",
61
- "@opengeni/storage": "^0.2.105-canary.0",
62
- "@opengeni/xai-subscription": "^0.1.1-canary.0",
46
+ "@opengeni/agent-proto": "^0.5.1-canary.1",
47
+ "@opengeni/artifact-tool": "^0.3.5-canary.0",
48
+ "@opengeni/capabilities": "^0.3.1-canary.0",
49
+ "@opengeni/codemode": "^0.4.13-canary.0",
50
+ "@opengeni/codex": "^0.2.19-canary.0",
51
+ "@opengeni/config": "^0.19.1-canary.0",
52
+ "@opengeni/contracts": "^2.3.0-canary.0",
53
+ "@opengeni/core": "^2.2.0-canary.0",
54
+ "@opengeni/db": "^3.2.0-canary.0",
55
+ "@opengeni/documents": "^0.7.0-canary.0",
56
+ "@opengeni/events": "^0.3.124-canary.0",
57
+ "@opengeni/github": "^0.5.3-canary.0",
58
+ "@opengeni/network": "^0.2.3-canary.0",
59
+ "@opengeni/observability": "^0.8.4-canary.0",
60
+ "@opengeni/runtime": "^1.3.1-canary.0",
61
+ "@opengeni/storage": "^0.2.106-canary.0",
62
+ "@opengeni/xai-subscription": "^0.1.2-canary.0",
63
63
  "@temporalio/client": "^1.17.0",
64
64
  "better-auth": "^1.6.14",
65
65
  "hono": "^4.12.18",
package/src/app.ts CHANGED
@@ -1461,6 +1461,10 @@ const routeLabelPatterns: Array<{
1461
1461
  pattern: /^\/v1\/workspaces\/[^/]+\/sessions\/[^/]+\/events$/,
1462
1462
  label: "/v1/workspaces/:workspaceId/sessions/:id/events",
1463
1463
  },
1464
+ {
1465
+ pattern: /^\/v1\/workspaces\/[^/]+\/sessions\/[^/]+\/turns$/,
1466
+ label: "/v1/workspaces/:workspaceId/sessions/:id/turns",
1467
+ },
1464
1468
  {
1465
1469
  pattern: /^\/v1\/workspaces\/[^/]+\/sessions\/[^/]+\/queue\/[^/]+\/(move|edit|steer|delete)$/,
1466
1470
  label: "/v1/workspaces/:workspaceId/sessions/:id/queue/:turnId/:action",
@@ -1925,6 +1929,10 @@ const routeLabelPatterns: Array<{
1925
1929
  pattern: /^\/v1\/github\/oauth\/callback$/,
1926
1930
  label: "/v1/github/oauth/callback",
1927
1931
  },
1932
+ {
1933
+ pattern: /^\/v1\/workspaces\/[^/]+$/,
1934
+ label: "/v1/workspaces/:workspaceId",
1935
+ },
1928
1936
  ];
1929
1937
 
1930
1938
  export function routeLabel(pathname: string): string {
@@ -207,6 +207,11 @@ export type SlackMessageBlock =
207
207
  style?: "primary" | "danger";
208
208
  }>;
209
209
  }
210
+ | {
211
+ type: "context";
212
+ block_id?: string;
213
+ elements: Array<{ type: "mrkdwn" | "plain_text"; text: string; emoji?: boolean }>;
214
+ }
210
215
  | { type: "divider" };
211
216
 
212
217
  export type SlackHomeBlock =