@tradejs/app 3.1.29-beta.265 → 3.1.29-beta.266

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": "@tradejs/app",
3
- "version": "3.1.29-beta.265",
3
+ "version": "3.1.29-beta.266",
4
4
  "description": "Installable Next.js UI for the TradeJS TypeScript framework: dashboards, backtests, charts, and runtime data.",
5
5
  "keywords": [
6
6
  "tradejs",
@@ -59,11 +59,11 @@
59
59
  "@emotion/react": "^11.14.0",
60
60
  "@modelcontextprotocol/sdk": "^1.32.1",
61
61
  "@node-oauth/oauth2-server": "^5.3.0",
62
- "@tradejs/core": "^3.1.29-beta.265",
63
- "@tradejs/indicators": "^3.1.29-beta.265",
64
- "@tradejs/infra": "^3.1.29-beta.265",
65
- "@tradejs/node": "^3.1.29-beta.265",
66
- "@tradejs/types": "^3.1.29-beta.265",
62
+ "@tradejs/core": "^3.1.29-beta.266",
63
+ "@tradejs/indicators": "^3.1.29-beta.266",
64
+ "@tradejs/infra": "^3.1.29-beta.266",
65
+ "@tradejs/node": "^3.1.29-beta.266",
66
+ "@tradejs/types": "^3.1.29-beta.266",
67
67
  "@types/bcryptjs": "2.4.6",
68
68
  "@types/lodash": "4.17.24",
69
69
  "@types/node": "24.13.3",
@@ -102,7 +102,27 @@ const verifyEntry = async (
102
102
  throw new Error('Unsupported artifact');
103
103
  };
104
104
 
105
- export const listMcpArtifacts = async (userName: string) => {
105
+ export interface McpArtifactListOptions {
106
+ deploymentId?: string;
107
+ kind?: CatalogEntry['kind'];
108
+ offset?: number;
109
+ limit?: number;
110
+ }
111
+
112
+ export const listMcpArtifacts = async (
113
+ userName: string,
114
+ options: McpArtifactListOptions = {},
115
+ ) => {
116
+ const offset = options.offset ?? 0;
117
+ const limit = options.limit ?? 20;
118
+ if (
119
+ !Number.isInteger(offset) ||
120
+ offset < 0 ||
121
+ !Number.isInteger(limit) ||
122
+ limit < 1 ||
123
+ limit > 100
124
+ )
125
+ throw new Error('Invalid artifact list pagination');
106
126
  const { deployments } = await readMcpDeployments(userName);
107
127
  const allowed = new Set(deployments.map((row) => row.id));
108
128
  const pending = [
@@ -113,7 +133,7 @@ export const listMcpArtifacts = async (userName: string) => {
113
133
  const items = [];
114
134
  let visited = 0;
115
135
  let invalidBundles = 0;
116
- while (pending.length && visited < 2000 && items.length < 100) {
136
+ while (pending.length && visited < 2000) {
117
137
  const current = pending.shift()!;
118
138
  visited++;
119
139
  let entries;
@@ -125,6 +145,12 @@ export const listMcpArtifacts = async (userName: string) => {
125
145
  if (entries.some((entry) => entry.name === '.complete' && entry.isFile())) {
126
146
  try {
127
147
  const artifact = await verifyEntry(current.dir, userName, allowed);
148
+ if (
149
+ options.deploymentId &&
150
+ artifact.deploymentId !== options.deploymentId
151
+ )
152
+ continue;
153
+ if (options.kind && artifact.kind !== options.kind) continue;
128
154
  await mcpStorage.put(storageKey(userName, artifact.id), artifact, 3600);
129
155
  items.push({
130
156
  id: artifact.id,
@@ -132,7 +158,7 @@ export const listMcpArtifacts = async (userName: string) => {
132
158
  deploymentId: artifact.deploymentId,
133
159
  sha256: artifact.sha256,
134
160
  bytes: artifact.bytes,
135
- manifest: artifact.manifest,
161
+ window: artifact.manifest.window,
136
162
  });
137
163
  } catch {
138
164
  invalidBundles++;
@@ -147,11 +173,18 @@ export const listMcpArtifacts = async (userName: string) => {
147
173
  });
148
174
  }
149
175
  }
176
+ items.sort((left, right) => left.id.localeCompare(right.id));
177
+ const page = items.slice(offset, offset + limit);
178
+ const nextOffset =
179
+ offset + page.length < items.length ? offset + page.length : null;
150
180
  return {
151
- items,
181
+ items: page,
182
+ offset,
183
+ nextOffset,
152
184
  observedAt: Date.now(),
153
185
  source: 'verified_local_bundles',
154
- truncated: pending.length > 0,
186
+ truncated: pending.length > 0 || nextOffset != null,
187
+ scanTruncated: pending.length > 0,
155
188
  invalidOrInaccessibleBundles: invalidBundles,
156
189
  note: 'Only verified, user-owned bundles available on this host are included.',
157
190
  };
@@ -396,8 +396,13 @@ export const createTradejsMcpServer = (principal: McpPrincipal) => {
396
396
  'diagnostics_list_reports',
397
397
  'List checksum-verified runtime evidence and feedback/parity bundles present on this host and owned by this user. Inaccessible/unverified bundles are excluded.',
398
398
  ['diagnostics:read'],
399
- {},
400
- async () => listMcpArtifacts(principal.userName),
399
+ {
400
+ deploymentId: z.string().optional(),
401
+ kind: z.enum(['runtime-evidence', 'runtime-feedback-replay']).optional(),
402
+ offset: z.number().int().min(0).default(0),
403
+ limit: z.number().int().min(1).max(100).default(20),
404
+ },
405
+ async (args) => listMcpArtifacts(principal.userName, args),
401
406
  );
402
407
  tool(
403
408
  'diagnostics_get_report',