@axiom-lattice/protocols 7.8.1 → 7.9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axiom-lattice/protocols",
3
- "version": "7.8.1",
3
+ "version": "7.9.0",
4
4
  "description": "Unified protocol type definitions for Axiom Lattice framework",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -78,6 +78,22 @@ export interface ChannelInstallation<TConfig = unknown> {
78
78
  config: TConfig;
79
79
  enabled: boolean;
80
80
  fallbackAgentId?: string;
81
+ /**
82
+ * Optional execution workspace for messages routed through this
83
+ * installation's fallback agent.
84
+ *
85
+ * Fallback routing has no persisted binding, so the installation is the only
86
+ * place that can carry the scope into the Agent run.
87
+ */
88
+ workspaceId?: string;
89
+ /**
90
+ * Optional execution project for messages routed through this installation's
91
+ * fallback agent.
92
+ *
93
+ * When set, sandbox creation mounts `/project` as a named volume and the run
94
+ * is project-scoped instead of falling back to the process-wide default.
95
+ */
96
+ projectId?: string;
81
97
  rejectWhenNoBinding: boolean;
82
98
  createdAt: Date;
83
99
  updatedAt: Date;
@@ -90,6 +106,8 @@ export interface CreateChannelInstallationInput {
90
106
  config: Record<string, unknown>;
91
107
  enabled?: boolean;
92
108
  fallbackAgentId?: string;
109
+ workspaceId?: string;
110
+ projectId?: string;
93
111
  rejectWhenNoBinding?: boolean;
94
112
  }
95
113
 
@@ -108,7 +126,10 @@ export interface UpdateChannelInstallationRequest {
108
126
  name?: string;
109
127
  config?: Record<string, unknown>;
110
128
  enabled?: boolean;
111
- fallbackAgentId?: string;
129
+ /** `null` clears the stored fallback agent; omitting the field leaves it unchanged. */
130
+ fallbackAgentId?: string | null;
131
+ workspaceId?: string;
132
+ projectId?: string;
112
133
  rejectWhenNoBinding?: boolean;
113
134
  }
114
135
 
@@ -133,6 +133,19 @@ export interface PlatformSettingsDocument {
133
133
  policies?: Record<string, PlatformRateLimitPolicyOverride>;
134
134
  /** PATCH-only command: remove platform overrides for these policies. */
135
135
  resetPolicies?: string[];
136
+ /**
137
+ * @deprecated Use `execution.maxActiveRunTasksPerTenant`.
138
+ * Legacy reads and writes are still accepted and normalized onto the
139
+ * `execution` leaf until this key is removed.
140
+ */
141
+ maxActiveRunTasksPerTenant?: number | null;
142
+ };
143
+ execution?: {
144
+ /** Maximum concurrent runs executed by one worker process (per process). */
145
+ maxConcurrentRunsPerWorker?: number;
146
+ /** Maximum running runs per tenant; `null` = unlimited. */
147
+ maxRunningRunsPerTenant?: number | null;
148
+ /** Maximum active run tasks per tenant; `null` = unlimited. */
136
149
  maxActiveRunTasksPerTenant?: number | null;
137
150
  };
138
151
  branding?: PlatformBrandingSettings;
@@ -154,6 +167,10 @@ export interface EffectivePlatformSettings {
154
167
  openAgentPerMinute: number;
155
168
  a2aJsonRpcPerMinute: number;
156
169
  a2aJsonRpcIpPerMinute: number;
170
+ };
171
+ execution: {
172
+ maxConcurrentRunsPerWorker: number;
173
+ maxRunningRunsPerTenant: number | null;
157
174
  maxActiveRunTasksPerTenant: number | null;
158
175
  };
159
176
  }
@@ -176,6 +193,7 @@ export interface PlatformSettingsProvider {
176
193
  getEffective(): EffectivePlatformSettings;
177
194
  getInviteDefaults(): EffectivePlatformSettings["invite"];
178
195
  getRateLimits(): EffectivePlatformSettings["rateLimits"];
196
+ getExecution(): EffectivePlatformSettings["execution"];
179
197
  /** Platform-only policy overrides; absent for consumers that do not need them. */
180
198
  getRateLimitPolicyOverrides?(): Record<string, PlatformRateLimitPolicyOverride>;
181
199
  }
@@ -220,6 +238,10 @@ export const PLATFORM_SETTINGS_DEFAULTS = {
220
238
  openAgentPerMinute: 2_000,
221
239
  a2aJsonRpcPerMinute: 600,
222
240
  a2aJsonRpcIpPerMinute: 300,
241
+ },
242
+ execution: {
243
+ maxConcurrentRunsPerWorker: 10,
244
+ maxRunningRunsPerTenant: null,
223
245
  maxActiveRunTasksPerTenant: null,
224
246
  },
225
247
  } as const satisfies EffectivePlatformSettings;
@@ -65,6 +65,14 @@ export interface CreateThreadRequest {
65
65
  expiresAt?: Date;
66
66
  }
67
67
 
68
+ /** Latest known sender for a channel installation. */
69
+ export interface ChannelSenderSummary {
70
+ senderId: string;
71
+ displayName?: string;
72
+ lastSeenAt: Date;
73
+ lastThreadId: string;
74
+ }
75
+
68
76
  /**
69
77
  * ThreadStore interface
70
78
  * Provides CRUD operations for thread data
@@ -159,6 +167,20 @@ export interface ThreadStore {
159
167
  tenantId: string,
160
168
  query?: ThreadMonitorQuery
161
169
  ): Promise<{ records: ThreadMonitorRecord[]; total: number }>;
170
+
171
+ /**
172
+ * List the latest known sender per channel installation.
173
+ *
174
+ * @param tenantId Tenant scope.
175
+ * @param channelInstallationId Channel installation to inspect.
176
+ * @param limit Maximum number of senders to return (clamped to 1..200).
177
+ * @returns Senders ordered by most recent activity.
178
+ */
179
+ listChannelSenders(
180
+ tenantId: string,
181
+ channelInstallationId: string,
182
+ limit: number
183
+ ): Promise<ChannelSenderSummary[]>;
162
184
  }
163
185
 
164
186
  /** Derived monitor kind for a persisted thread. */
@@ -0,0 +1,14 @@
1
+ import { PLATFORM_SETTINGS_DEFAULTS } from "../PlatformSettingsProtocol";
2
+
3
+ describe("execution defaults", () => {
4
+ it("defaults to 10 per worker and unlimited tenant caps", () => {
5
+ expect(PLATFORM_SETTINGS_DEFAULTS.execution).toEqual({
6
+ maxConcurrentRunsPerWorker: 10,
7
+ maxRunningRunsPerTenant: null,
8
+ maxActiveRunTasksPerTenant: null,
9
+ });
10
+ expect(PLATFORM_SETTINGS_DEFAULTS.rateLimits).not.toHaveProperty(
11
+ "maxActiveRunTasksPerTenant",
12
+ );
13
+ });
14
+ });