@cyanheads/secedgar-mcp-server 0.18.1 → 0.19.1

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.
Files changed (141) hide show
  1. package/AGENTS.md +36 -24
  2. package/CLAUDE.md +36 -24
  3. package/README.md +16 -12
  4. package/changelog/0.19.x/0.19.0.md +47 -0
  5. package/changelog/0.19.x/0.19.1.md +35 -0
  6. package/changelog/template.md +10 -3
  7. package/dist/config/server-config.js +2 -2
  8. package/dist/config/server-config.js.map +1 -1
  9. package/dist/index.js +27 -9
  10. package/dist/index.js.map +1 -1
  11. package/dist/mcp-server/tools/dataset-schema.d.ts +14 -0
  12. package/dist/mcp-server/tools/dataset-schema.d.ts.map +1 -0
  13. package/dist/mcp-server/tools/dataset-schema.js +16 -0
  14. package/dist/mcp-server/tools/dataset-schema.js.map +1 -0
  15. package/dist/mcp-server/tools/definitions/company-search.tool.d.ts +44 -14
  16. package/dist/mcp-server/tools/definitions/company-search.tool.d.ts.map +1 -1
  17. package/dist/mcp-server/tools/definitions/company-search.tool.js +197 -62
  18. package/dist/mcp-server/tools/definitions/company-search.tool.js.map +1 -1
  19. package/dist/mcp-server/tools/definitions/compare-companies.tool.d.ts +26 -12
  20. package/dist/mcp-server/tools/definitions/compare-companies.tool.d.ts.map +1 -1
  21. package/dist/mcp-server/tools/definitions/compare-companies.tool.js +41 -39
  22. package/dist/mcp-server/tools/definitions/compare-companies.tool.js.map +1 -1
  23. package/dist/mcp-server/tools/definitions/dataframe-describe.tool.d.ts +12 -3
  24. package/dist/mcp-server/tools/definitions/dataframe-describe.tool.d.ts.map +1 -1
  25. package/dist/mcp-server/tools/definitions/dataframe-describe.tool.js +23 -9
  26. package/dist/mcp-server/tools/definitions/dataframe-describe.tool.js.map +1 -1
  27. package/dist/mcp-server/tools/definitions/dataframe-drop.tool.js +2 -2
  28. package/dist/mcp-server/tools/definitions/dataframe-drop.tool.js.map +1 -1
  29. package/dist/mcp-server/tools/definitions/dataframe-query.tool.d.ts +16 -16
  30. package/dist/mcp-server/tools/definitions/dataframe-query.tool.d.ts.map +1 -1
  31. package/dist/mcp-server/tools/definitions/dataframe-query.tool.js +17 -17
  32. package/dist/mcp-server/tools/definitions/dataframe-query.tool.js.map +1 -1
  33. package/dist/mcp-server/tools/definitions/fetch-frames.tool.d.ts +26 -12
  34. package/dist/mcp-server/tools/definitions/fetch-frames.tool.d.ts.map +1 -1
  35. package/dist/mcp-server/tools/definitions/fetch-frames.tool.js +15 -37
  36. package/dist/mcp-server/tools/definitions/fetch-frames.tool.js.map +1 -1
  37. package/dist/mcp-server/tools/definitions/find-holders.tool.d.ts +36 -20
  38. package/dist/mcp-server/tools/definitions/find-holders.tool.d.ts.map +1 -1
  39. package/dist/mcp-server/tools/definitions/find-holders.tool.js +26 -41
  40. package/dist/mcp-server/tools/definitions/find-holders.tool.js.map +1 -1
  41. package/dist/mcp-server/tools/definitions/get-beneficial-owners.tool.d.ts +28 -12
  42. package/dist/mcp-server/tools/definitions/get-beneficial-owners.tool.d.ts.map +1 -1
  43. package/dist/mcp-server/tools/definitions/get-beneficial-owners.tool.js +30 -44
  44. package/dist/mcp-server/tools/definitions/get-beneficial-owners.tool.js.map +1 -1
  45. package/dist/mcp-server/tools/definitions/get-filing.tool.d.ts +50 -14
  46. package/dist/mcp-server/tools/definitions/get-filing.tool.d.ts.map +1 -1
  47. package/dist/mcp-server/tools/definitions/get-filing.tool.js +193 -59
  48. package/dist/mcp-server/tools/definitions/get-filing.tool.js.map +1 -1
  49. package/dist/mcp-server/tools/definitions/get-financials.tool.d.ts +14 -6
  50. package/dist/mcp-server/tools/definitions/get-financials.tool.d.ts.map +1 -1
  51. package/dist/mcp-server/tools/definitions/get-financials.tool.js +38 -41
  52. package/dist/mcp-server/tools/definitions/get-financials.tool.js.map +1 -1
  53. package/dist/mcp-server/tools/definitions/get-fund-holdings.tool.d.ts +28 -12
  54. package/dist/mcp-server/tools/definitions/get-fund-holdings.tool.d.ts.map +1 -1
  55. package/dist/mcp-server/tools/definitions/get-fund-holdings.tool.js +22 -35
  56. package/dist/mcp-server/tools/definitions/get-fund-holdings.tool.js.map +1 -1
  57. package/dist/mcp-server/tools/definitions/get-insider-transactions.tool.d.ts +28 -12
  58. package/dist/mcp-server/tools/definitions/get-insider-transactions.tool.d.ts.map +1 -1
  59. package/dist/mcp-server/tools/definitions/get-insider-transactions.tool.js +22 -31
  60. package/dist/mcp-server/tools/definitions/get-insider-transactions.tool.js.map +1 -1
  61. package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.d.ts +36 -20
  62. package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.d.ts.map +1 -1
  63. package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.js +22 -39
  64. package/dist/mcp-server/tools/definitions/get-institutional-holdings.tool.js.map +1 -1
  65. package/dist/mcp-server/tools/definitions/get-material-events.tool.d.ts +28 -12
  66. package/dist/mcp-server/tools/definitions/get-material-events.tool.d.ts.map +1 -1
  67. package/dist/mcp-server/tools/definitions/get-material-events.tool.js +23 -32
  68. package/dist/mcp-server/tools/definitions/get-material-events.tool.js.map +1 -1
  69. package/dist/mcp-server/tools/definitions/get-snapshot.tool.d.ts +16 -7
  70. package/dist/mcp-server/tools/definitions/get-snapshot.tool.d.ts.map +1 -1
  71. package/dist/mcp-server/tools/definitions/get-snapshot.tool.js +24 -32
  72. package/dist/mcp-server/tools/definitions/get-snapshot.tool.js.map +1 -1
  73. package/dist/mcp-server/tools/definitions/index.d.ts +232 -101
  74. package/dist/mcp-server/tools/definitions/index.d.ts.map +1 -1
  75. package/dist/mcp-server/tools/definitions/search-concepts.tool.js +3 -3
  76. package/dist/mcp-server/tools/definitions/search-concepts.tool.js.map +1 -1
  77. package/dist/mcp-server/tools/definitions/search-filings.tool.d.ts +46 -20
  78. package/dist/mcp-server/tools/definitions/search-filings.tool.d.ts.map +1 -1
  79. package/dist/mcp-server/tools/definitions/search-filings.tool.js +126 -68
  80. package/dist/mcp-server/tools/definitions/search-filings.tool.js.map +1 -1
  81. package/dist/mcp-server/tools/resolved-as.d.ts +10 -0
  82. package/dist/mcp-server/tools/resolved-as.d.ts.map +1 -0
  83. package/dist/mcp-server/tools/resolved-as.js +13 -0
  84. package/dist/mcp-server/tools/resolved-as.js.map +1 -0
  85. package/dist/mcp-server/tools/sec-upstream-errors.d.ts +44 -0
  86. package/dist/mcp-server/tools/sec-upstream-errors.d.ts.map +1 -0
  87. package/dist/mcp-server/tools/sec-upstream-errors.js +48 -0
  88. package/dist/mcp-server/tools/sec-upstream-errors.js.map +1 -0
  89. package/dist/services/canvas-bridge/canvas-bridge.d.ts +98 -45
  90. package/dist/services/canvas-bridge/canvas-bridge.d.ts.map +1 -1
  91. package/dist/services/canvas-bridge/canvas-bridge.js +137 -126
  92. package/dist/services/canvas-bridge/canvas-bridge.js.map +1 -1
  93. package/dist/services/canvas-bridge/sql-gate-extras.d.ts +4 -17
  94. package/dist/services/canvas-bridge/sql-gate-extras.d.ts.map +1 -1
  95. package/dist/services/canvas-bridge/sql-gate-extras.js +4 -22
  96. package/dist/services/canvas-bridge/sql-gate-extras.js.map +1 -1
  97. package/dist/services/edgar/concept-map.d.ts +10 -6
  98. package/dist/services/edgar/concept-map.d.ts.map +1 -1
  99. package/dist/services/edgar/concept-map.js +90 -22
  100. package/dist/services/edgar/concept-map.js.map +1 -1
  101. package/dist/services/edgar/data/former-tickers.json +24159 -0
  102. package/dist/services/edgar/edgar-api-service.d.ts +250 -62
  103. package/dist/services/edgar/edgar-api-service.d.ts.map +1 -1
  104. package/dist/services/edgar/edgar-api-service.js +808 -189
  105. package/dist/services/edgar/edgar-api-service.js.map +1 -1
  106. package/dist/services/edgar/filing-to-text.d.ts +71 -2
  107. package/dist/services/edgar/filing-to-text.d.ts.map +1 -1
  108. package/dist/services/edgar/filing-to-text.js +533 -5
  109. package/dist/services/edgar/filing-to-text.js.map +1 -1
  110. package/dist/services/edgar/former-tickers.d.ts +47 -0
  111. package/dist/services/edgar/former-tickers.d.ts.map +1 -0
  112. package/dist/services/edgar/former-tickers.js +77 -0
  113. package/dist/services/edgar/former-tickers.js.map +1 -0
  114. package/dist/services/edgar/listing-codes.d.ts +47 -0
  115. package/dist/services/edgar/listing-codes.d.ts.map +1 -0
  116. package/dist/services/edgar/listing-codes.js +110 -0
  117. package/dist/services/edgar/listing-codes.js.map +1 -0
  118. package/dist/services/edgar/mirror/edgar-mirror.d.ts +11 -1
  119. package/dist/services/edgar/mirror/edgar-mirror.d.ts.map +1 -1
  120. package/dist/services/edgar/mirror/edgar-mirror.js +19 -1
  121. package/dist/services/edgar/mirror/edgar-mirror.js.map +1 -1
  122. package/dist/services/edgar/mirror/tickers-sync.d.ts.map +1 -1
  123. package/dist/services/edgar/mirror/tickers-sync.js +1 -3
  124. package/dist/services/edgar/mirror/tickers-sync.js.map +1 -1
  125. package/dist/services/edgar/mirror/types.d.ts +3 -1
  126. package/dist/services/edgar/mirror/types.d.ts.map +1 -1
  127. package/dist/services/edgar/mirror/types.js +3 -1
  128. package/dist/services/edgar/mirror/types.js.map +1 -1
  129. package/dist/services/edgar/trigram-similarity.d.ts +5 -3
  130. package/dist/services/edgar/trigram-similarity.d.ts.map +1 -1
  131. package/dist/services/edgar/trigram-similarity.js +18 -17
  132. package/dist/services/edgar/trigram-similarity.js.map +1 -1
  133. package/dist/services/edgar/types.d.ts +20 -7
  134. package/dist/services/edgar/types.d.ts.map +1 -1
  135. package/package.json +6 -5
  136. package/server.json +3 -3
  137. package/skills/secedgar-guide/SKILL.md +3 -3
  138. package/dist/mcp-server/tools/escape-inline.d.ts +0 -35
  139. package/dist/mcp-server/tools/escape-inline.d.ts.map +0 -1
  140. package/dist/mcp-server/tools/escape-inline.js +0 -51
  141. package/dist/mcp-server/tools/escape-inline.js.map +0 -1
@@ -1,19 +1,22 @@
1
1
  /**
2
2
  * @fileoverview Adapter between the SEC EDGAR tools and the framework
3
- * DataCanvas primitive. Holds one shared canvas per tenant, generates
4
- * `df_XXXXX_XXXXX` table names, tracks per-table TTL + provenance in
5
- * `ctx.state`, and lazy-sweeps expired metadata on every public op. The
6
- * framework handles DuckDB-level TTL via `RegisterTableOptions.ttlMs`;
7
- * system-catalog access is denied via `QueryOptions.denySystemCatalogs`.
8
- * Best-effort: failed canvas operations log a warning and return
9
- * `undefined`/empty so the caller's inline response remains useful.
3
+ * DataCanvas primitive. Reaches the tenant's one shared canvas through
4
+ * `DataCanvas.acquireShared`, which keeps its id in `ctx.state`, mints it once
5
+ * under concurrent first calls, and purges the `df-meta/` records of a canvas
6
+ * that died before minting the next (#241). Generates `df_XXXXX_XXXXX` table
7
+ * names, tracks per-table TTL + provenance in `ctx.state`, and lazy-sweeps
8
+ * expired metadata on every public op. The framework handles DuckDB-level TTL
9
+ * via `RegisterTableOptions.ttlMs`; system-catalog access is denied via
10
+ * `QueryOptions.denySystemCatalogs`. Registration is best-effort: a failed
11
+ * canvas operation logs a warning and returns `undefined` so the producing
12
+ * tool's inline response remains useful.
10
13
  * @module services/canvas-bridge/canvas-bridge
11
14
  */
12
15
  import { inferSchemaFromRows, } from '@cyanheads/mcp-ts-core/canvas';
13
16
  import { McpError, notFound, validationError } from '@cyanheads/mcp-ts-core/errors';
14
17
  import { idGenerator } from '@cyanheads/mcp-ts-core/utils';
15
18
  import { getServerConfig } from '../../config/server-config.js';
16
- import { isSelectShaped, stripStringLiterals } from './sql-gate-extras.js';
19
+ import { stripStringLiterals } from './sql-gate-extras.js';
17
20
  /**
18
21
  * Wire shape for the `dataset` field on tool outputs. Callers spread
19
22
  * additional fields (e.g. `truncated`) when applicable.
@@ -45,15 +48,37 @@ export function dataframeGuidance(dataset) {
45
48
  return `${staged} — use secedgar_dataframe_describe to inspect its columns, then secedgar_dataframe_query to analyze it with SQL.`;
46
49
  }
47
50
  const META_PREFIX = 'df-meta/';
51
+ /**
52
+ * The one shape a dataframe name takes: what {@link CanvasBridge} mints and what
53
+ * `register_as` accepts. A name of any other shape names no dataframe, so it is
54
+ * answered as unknown without a `ctx.state` read, whose key rules would
55
+ * otherwise reject it with a reason-less storage error.
56
+ */
57
+ export const DATAFRAME_NAME_RE = /^df_[A-Z0-9]{5}_[A-Z0-9]{5}$/;
48
58
  /** Recovery hint for a `register_as` name that collides with an existing dataframe (#60). */
49
- const REGISTER_AS_CLASH_HINT = 'Drop the existing dataframe with secedgar_dataframe_drop (when enabled), choose a different df_XXXXX_XXXXX name, or omit register_as.';
50
- const CANVAS_ID_KEY = 'canvas-id';
59
+ export const REGISTER_AS_CLASH_HINT = 'Drop the existing dataframe with secedgar_dataframe_drop (when enabled), choose a different df_XXXXX_XXXXX name, or omit register_as.';
60
+ /**
61
+ * Recovery hint for a `df_<id>` the canvas does not hold (#47, #54). It points at
62
+ * the name the producing tool returned and says where listing is refused, so it
63
+ * reads true in both deployment shapes (#242).
64
+ */
65
+ export const MISSING_TABLE_HINT = 'Reference the df_<id> name the producing tool returned in its `dataset` field, or a register_as name, and re-run that tool if the table expired. secedgar_dataframe_describe without a name lists the active dataframes, except over HTTP with auth none, where that listing is refused.';
66
+ /** Recovery hint for SQL that names a DuckDB system catalog or metadata view, as a table or as an alias. */
67
+ export const SYSTEM_CATALOG_HINT = 'Query only the df_<id> tables, by the name the producing tool returned in its `dataset` field; a column alias, table alias, or CTE named like a DuckDB metadata view (the name the message gives) is refused too, so rename it.';
68
+ /** Recovery hint for SQL that names a file as a table, or otherwise asks the engine to read or write outside the canvas. */
69
+ export const SQL_READ_ONLY_HINT = 'Query only the df_<id> tables, by the name the producing tool returned in its `dataset` field, referenced by bare name; this surface reads no files and cannot create, alter, or drop anything.';
51
70
  /** Token character set for `df_XXXXX_XXXXX` table names. */
52
71
  const TABLE_NAME_CHARSET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
53
72
  export class CanvasBridge {
54
73
  canvas;
55
- constructor(canvas) {
74
+ options;
75
+ constructor(canvas, options) {
56
76
  this.canvas = canvas;
77
+ this.options = options;
78
+ }
79
+ /** Whether a describe without a name may list every dataframe (#242). */
80
+ get listingEnabled() {
81
+ return this.options.listingEnabled;
57
82
  }
58
83
  /**
59
84
  * Persist a row set as `df_<id>` on the tenant's shared canvas. Returns
@@ -69,7 +94,7 @@ export class CanvasBridge {
69
94
  }
70
95
  try {
71
96
  await this.sweepExpired(ctx);
72
- const instance = await this.acquireSharedCanvas(ctx);
97
+ const instance = await this.canvasFor(ctx, true);
73
98
  const tableName = this.mintTableName();
74
99
  // inferSchemaFromRows always emits nullable: true since mcp-ts-core 0.10.4,
75
100
  // so the explicit force-nullable pass is no longer needed.
@@ -111,12 +136,18 @@ export class CanvasBridge {
111
136
  }
112
137
  }
113
138
  /**
114
- * List dataframes with provenance. Sweeps expired tables first so the
115
- * listing reflects what's actually queryable.
139
+ * The named dataframe's provenance, or every dataframe's when `tableName` is
140
+ * omitted. Resolves the live canvas first, without minting one, so the records
141
+ * of a canvas that died are purged before any is read; then sweeps expired
142
+ * tables, so what is returned is what a query can reach. A name not shaped
143
+ * like a dataframe name returns nothing, reading no state.
116
144
  */
117
145
  async describe(ctx, tableName) {
146
+ if (tableName !== undefined && !DATAFRAME_NAME_RE.test(tableName))
147
+ return [];
148
+ await this.canvasFor(ctx, false);
118
149
  await this.sweepExpired(ctx);
119
- if (tableName) {
150
+ if (tableName !== undefined) {
120
151
  const meta = await ctx.state.get(`${META_PREFIX}${tableName}`);
121
152
  return meta ? [meta] : [];
122
153
  }
@@ -126,26 +157,27 @@ export class CanvasBridge {
126
157
  return entries.sort((a, b) => b.createdAt.localeCompare(a.createdAt));
127
158
  }
128
159
  /**
129
- * Run a SELECT against the shared canvas. Framework gate runs inside
130
- * `canvas.query`; this method additionally rejects system-catalog access
131
- * before handing the SQL off. Optional `registerAs` chains the result as a
132
- * new dataframe with a fresh per-table TTL (not inherited from parents).
160
+ * Run a SELECT against the shared canvas, minting it when none is live. The
161
+ * framework's read-only gate runs inside `instance.query`, with
162
+ * `denySystemCatalogs` set. Optional `registerAs` chains the result as a new
163
+ * dataframe with a fresh per-table TTL (not inherited from parents).
133
164
  *
134
- * A pre-check surfaces a structured `missing_table` for an unregistered or
135
- * TTL-expired `df_<id>` before the framework gate's generic rejection. Any raw
136
- * DuckDB execution error that escapes the gate is re-thrown as a structured
137
- * `invalid_sql`; framework errors matching a declared tool-contract reason
138
- * (`missing_table`, `register_as_clash`, `system_catalog_access`) are rebuilt
139
- * with the contract recovery hint (#47, #54, #60); other structured McpErrors
140
- * propagate as-is — including the framework's `sql_execution_error` (a SELECT
141
- * that prepared and then failed on the data), `invalid_sql`, `multi_statement`,
142
- * `denied_function`, `sql_read_only`, and `plan_operator_not_allowed`, each of
143
- * which already carries its own recovery hint.
165
+ * A pre-check answers an unregistered or TTL-expired `df_<id>` as
166
+ * `missing_table` from the records alone, before the canvas is acquired. Any
167
+ * raw DuckDB execution error that escapes the gate is re-thrown as a structured
168
+ * `invalid_sql`. The framework's `missing_table`, `register_as_clash`, and
169
+ * `system_catalog_access` are rebuilt with this server's recovery hints (#47,
170
+ * #54, #60), as is `sql_read_only`, whose engine hint points at a listing
171
+ * (#242), and its `non_select_statement` without the `statementType` it
172
+ * carries; other structured McpErrors propagate as-is — the framework's
173
+ * `sql_execution_error` (a SELECT that prepared and then failed on the data),
174
+ * `invalid_sql`, `multi_statement`, `denied_function`, and
175
+ * `plan_operator_not_allowed`, each with its own recovery hint.
144
176
  */
145
177
  async query(ctx, sql, options = {}) {
146
178
  await this.sweepExpired(ctx);
147
179
  await this.assertReferencedDataframesExist(ctx, sql);
148
- const instance = await this.acquireSharedCanvas(ctx);
180
+ const instance = await this.canvasFor(ctx, true);
149
181
  const registerAs = options.registerAs;
150
182
  // (#60) Reject a clashing register_as target against tracked dataframes before
151
183
  // the provider runs: the framework's own clash rejection is reclassified to a
@@ -178,43 +210,21 @@ export class CanvasBridge {
178
210
  catch (err) {
179
211
  if (err instanceof McpError) {
180
212
  const data = err.data;
181
- // (#54) The framework gate's missing_table message and hint name internal SDK
182
- // methods ("registerTable()", "describe()"). Rebuild both with agent-facing
183
- // tool guidance so clients see consistent recovery text regardless of which
184
- // code path rejected.
213
+ // (#54) The framework's missing_table hint points at a generic describe tool.
214
+ // Rebuild it with this server's guidance, so a missing table reads the same
215
+ // whether the records or the canvas refused it.
185
216
  if (data?.reason === 'missing_table') {
186
217
  const tableName = data.tableName;
187
218
  const subject = typeof tableName === 'string' ? `Canvas table "${tableName}"` : 'Canvas table';
188
219
  throw notFound(`${subject} does not exist — it may have expired or was never registered.`, {
189
220
  reason: 'missing_table',
190
221
  ...(tableName !== undefined && { tableName }),
191
- recovery: {
192
- hint: 'Use secedgar_dataframe_describe to list available dataframes and verify the table name.',
193
- },
194
- });
195
- }
196
- // (#52) The framework gate prepares every statement. When a SELECT has an
197
- // unknown column, DuckDB's binder throws before it can determine the statement
198
- // type, so the gate assigns statementType: 'UNKNOWN' and reason:
199
- // 'non_select_statement'. Guard on UNKNOWN (a genuine non-SELECT that prepares
200
- // successfully carries its real statementType, e.g. 'INSERT') and re-check the
201
- // SQL text — if it starts with SELECT or WITH it was a column/expression error,
202
- // not a non-SELECT. The framework discards the binder detail, so we cannot name
203
- // the offending column; point to dataframe_describe instead.
204
- if (data?.reason === 'non_select_statement' &&
205
- data?.statementType === 'UNKNOWN' &&
206
- isSelectShaped(sql)) {
207
- throw validationError('The query is SELECT-shaped but failed to prepare — most likely an unknown column name or invalid expression. Use secedgar_dataframe_describe to check column names.', {
208
- reason: 'invalid_sql',
209
- recovery: {
210
- hint: 'Use secedgar_dataframe_describe to check column names and verify the query.',
211
- },
222
+ recovery: { hint: MISSING_TABLE_HINT },
212
223
  });
213
224
  }
214
- // (#60) A framework-origin error arrives with the gate's generic hint, which
215
- // the contract fill never replaces, or with none. Rebuild
216
- // both remaining declared reasons with their contract recovery text, mirroring
217
- // the missing_table treatment above.
225
+ // (#60) A framework-origin clash arrives with the gate's generic hint, which
226
+ // the contract fill never replaces, or with none. Rebuild it with the
227
+ // contract recovery text, mirroring the missing_table treatment above.
218
228
  if (data?.reason === 'register_as_clash') {
219
229
  const tableName = data.tableName;
220
230
  const subject = typeof tableName === 'string'
@@ -226,33 +236,35 @@ export class CanvasBridge {
226
236
  recovery: { hint: REGISTER_AS_CLASH_HINT },
227
237
  });
228
238
  }
239
+ // The gate's hint sends the caller to a listing and is silent on the alias
240
+ // case: its name scan refuses a column alias, table alias, or CTE spelled
241
+ // like a metadata view as readily as the view itself.
229
242
  if (data?.reason === 'system_catalog_access') {
230
243
  throw validationError(err.message, {
231
244
  ...data,
232
- recovery: {
233
- hint: 'Query only df_<id> tables. Use secedgar_dataframe_describe to list available dataframes.',
234
- },
245
+ recovery: { hint: SYSTEM_CATALOG_HINT },
235
246
  });
236
247
  }
237
- // (#74) A genuine non-SELECT (statementType 'DROP', 'INSERT', etc.) skips the
238
- // #52 UNKNOWN reclassification above and would otherwise propagate without a
239
- // recovery hint. Rewrap it — mirroring the reason-preserving rewraps above —
240
- // so the declared contract guidance reaches the wire. The reason stays
241
- // 'non_select_statement'; only recovery is added.
248
+ // The engine's hint sends the caller to a listing, which is refused over HTTP
249
+ // with auth none (#242).
250
+ if (data?.reason === 'sql_read_only') {
251
+ throw validationError(err.message, { ...data, recovery: { hint: SQL_READ_ONLY_HINT } });
252
+ }
253
+ // (#74) The gate refuses every non-SELECT before it is prepared, as
254
+ // `statementType: 'UNKNOWN'` on every path but an EXPLAIN failure, where it is
255
+ // 'SELECT'; no caller reads it, so it stays off the wire. The gate's hint is
256
+ // kept: it is written per shape (a PIVOT without an IN list names the list),
257
+ // and the contract's recovery fills in when one is ever missing.
242
258
  if (data?.reason === 'non_select_statement') {
243
- throw validationError(err.message, {
244
- ...data,
245
- recovery: {
246
- hint: 'Query only SELECT statements against df_<id> tables. Use secedgar_dataframe_describe to inspect available dataframes.',
247
- },
248
- });
259
+ const { statementType: _statementType, ...rest } = data;
260
+ throw validationError(err.message, rest);
249
261
  }
250
262
  // All other structured McpErrors propagate as-is.
251
263
  throw err;
252
264
  }
253
265
  // Any unclassified raw DuckDB execution error that escaped the framework's
254
- // prepare gate → structured invalid_sql. Missing tables are handled by the
255
- // pre-check above (the gate rejects an unbindable statement first).
266
+ // prepare gate → structured invalid_sql. A missing table arrives as the
267
+ // framework's missing_table, rebuilt above.
256
268
  const msg = err instanceof Error ? err.message : String(err);
257
269
  throw validationError(msg, {
258
270
  reason: 'invalid_sql',
@@ -270,15 +282,7 @@ export class CanvasBridge {
270
282
  // serializes BIGINT as strings in query results (would mistype as VARCHAR),
271
283
  // and a zero-row result has nothing to sniff. describe() is authoritative
272
284
  // for both. Framework always emits nullable: true on inferred columns since 0.10.4.
273
- //
274
- // WORKAROUND (#53): instance.describe({ tableName }) triggers a DuckDB binder
275
- // error — "Ambiguous reference to column name 'table_name'" — because the
276
- // framework's describe() pushes an unqualified table_name filter into a WHERE
277
- // clause where a LEFT JOIN to duckdb_tables() is in scope. Use the unfiltered
278
- // describe() and find the entry by name instead. Revert to describe({ tableName })
279
- // when the framework qualifies the filter (t.table_name).
280
- const allTables = await instance.describe();
281
- const info = allTables.find((t) => t.name === tableName);
285
+ const [info] = await instance.describe({ tableName, signal: ctx.signal });
282
286
  const columnSchema = info?.columns ?? result.columns.map((name) => ({ name, type: 'VARCHAR' }));
283
287
  meta = {
284
288
  tableName,
@@ -296,14 +300,13 @@ export class CanvasBridge {
296
300
  return meta ? { result, meta } : { result };
297
301
  }
298
302
  /**
299
- * Surface a helpful, structured `missing_table` for a referenced `df_<id>`
300
- * handle that isn't registered — mistyped, or TTL-expired since it was minted.
301
- * Runs before the framework SQL gate, which otherwise rejects an unbindable
302
- * table with a generic "could not be prepared" `non_select_statement` (the gate
303
- * prepares every statement, so a missing table fails there first). Only the
304
- * minted-handle pattern `df_<5>_<5>` is checked; string literals are stripped so
305
- * a quoted handle never false-triggers, and other identifiers fall through to
306
- * the gate (#47).
303
+ * Answer a referenced `df_<id>` handle with no record — mistyped, or
304
+ * TTL-expired since it was minted — as `missing_table` from the records
305
+ * alone, before the canvas is acquired, so a mistyped handle mints no canvas.
306
+ * Only the minted-handle pattern `df_<5>_<5>` is checked; string literals and
307
+ * quoted identifiers are stripped so a quoted handle never false-triggers, and
308
+ * other identifiers fall through to the gate, which answers a table the canvas
309
+ * lacks as `missing_table` itself (#47).
307
310
  */
308
311
  async assertReferencedDataframesExist(ctx, sql) {
309
312
  const referenced = stripStringLiterals(sql).match(/\bdf_[A-Z0-9]{5}_[A-Z0-9]{5}\b/g);
@@ -313,27 +316,30 @@ export class CanvasBridge {
313
316
  if ((await ctx.state.get(`${META_PREFIX}${name}`)) === null) {
314
317
  throw notFound(`Dataframe '${name}' does not exist or has expired.`, {
315
318
  reason: 'missing_table',
316
- recovery: {
317
- hint: 'Use secedgar_dataframe_describe to list available dataframes, then reference one of those names.',
318
- },
319
+ recovery: { hint: MISSING_TABLE_HINT },
319
320
  });
320
321
  }
321
322
  }
322
323
  }
323
324
  /**
324
- * Idempotent drop. Removes the table from the canvas and the metadata
325
- * entry from `ctx.state`. Returns true when the table was found and
326
- * removed; false when neither side had it.
325
+ * Idempotent drop. Removes the table from the live canvas and the metadata
326
+ * entry from `ctx.state`, minting no canvas. Returns true when either side
327
+ * had it; false when neither did, or the name is not shaped like a dataframe
328
+ * name, which reads no state.
327
329
  */
328
330
  async drop(ctx, tableName) {
331
+ if (!DATAFRAME_NAME_RE.test(tableName))
332
+ return false;
333
+ // Resolved before the record is read, so a dead canvas's purged record never reports a drop.
334
+ const instance = await this.canvasFor(ctx, false);
329
335
  await this.sweepExpired(ctx);
330
336
  const metaKey = `${META_PREFIX}${tableName}`;
331
337
  const hadMeta = (await ctx.state.get(metaKey)) !== null;
332
338
  await ctx.state.delete(metaKey);
339
+ if (!instance)
340
+ return hadMeta;
333
341
  try {
334
- const instance = await this.acquireSharedCanvas(ctx);
335
- const dropped = await instance.drop(tableName);
336
- return dropped || hadMeta;
342
+ return (await instance.drop(tableName)) || hadMeta;
337
343
  }
338
344
  catch (error) {
339
345
  ctx.log.warning('Canvas drop failed', {
@@ -345,16 +351,18 @@ export class CanvasBridge {
345
351
  }
346
352
  /**
347
353
  * Iterate provenance entries, drop tables whose `expiresAt` is in the
348
- * past. Best-effort: a failure to drop one table does not stop the sweep
349
- * for others.
354
+ * past. The live canvas is resolved only once an expired entry turns up, and
355
+ * never minted: with none live, the entry's record alone is deleted.
356
+ * Best-effort: a failure to drop one table does not stop the sweep for others.
350
357
  */
351
358
  async sweepExpired(ctx) {
352
359
  const nowIso = new Date().toISOString();
353
- let instance;
360
+ let live;
354
361
  for await (const { key, meta } of this.iterateMeta(ctx)) {
355
362
  if (meta.expiresAt > nowIso)
356
363
  continue;
357
- instance ??= await this.acquireSharedCanvas(ctx).catch(() => undefined);
364
+ live ??= this.canvasFor(ctx, false);
365
+ const instance = await live;
358
366
  if (instance) {
359
367
  try {
360
368
  await instance.drop(meta.tableName);
@@ -391,24 +399,20 @@ export class CanvasBridge {
391
399
  cursor = page.cursor;
392
400
  } while (cursor);
393
401
  }
402
+ canvasFor(ctx, create) {
403
+ return this.canvas.acquireShared(ctx, { create, onReplace: () => this.purgeMeta(ctx) });
404
+ }
394
405
  /**
395
- * Acquire the tenant's shared canvas. Reuse the stored canvas ID when one
396
- * is still live; mint a fresh canvas when the stored ID is unknown or
397
- * expired (registry returns NotFound; `acquire(undefined)` mints a new one).
406
+ * Delete every `df-meta/` record: the tables they describe died with the
407
+ * canvas that held them. Idempotent, since `acquireShared` runs it again after
408
+ * it throws, after a failed mint, and after the lock holder is cancelled.
398
409
  */
399
- async acquireSharedCanvas(ctx) {
400
- const stored = await ctx.state.get(CANVAS_ID_KEY);
401
- if (stored) {
402
- try {
403
- return await this.canvas.acquire(stored, ctx);
404
- }
405
- catch {
406
- await ctx.state.delete(CANVAS_ID_KEY);
407
- }
408
- }
409
- const instance = await this.canvas.acquire(undefined, ctx);
410
- await ctx.state.set(CANVAS_ID_KEY, instance.canvasId);
411
- return instance;
410
+ async purgeMeta(ctx) {
411
+ const keys = [];
412
+ for await (const { key } of this.iterateMeta(ctx))
413
+ keys.push(key);
414
+ if (keys.length > 0)
415
+ await ctx.state.deleteMany(keys);
412
416
  }
413
417
  /** Mint a `df_XXXXX_XXXXX` table name (14 chars, ~3.7×10^15 keyspace). */
414
418
  mintTableName() {
@@ -420,12 +424,19 @@ export class CanvasBridge {
420
424
  let _bridge;
421
425
  /**
422
426
  * Wire the canvas bridge during `setup()`. `canvas` is `undefined` when the
423
- * framework didn't construct a DataCanvas (`CANVAS_PROVIDER_TYPE=none`,
424
- * default, or Workers). Tools that materialize dataframes call
425
- * {@link getCanvasBridge} and skip materialization when the bridge is absent.
427
+ * framework didn't construct a DataCanvas (`CANVAS_PROVIDER_TYPE=none`, or
428
+ * Workers). Tools that materialize dataframes call {@link getCanvasBridge} and
429
+ * skip materialization when the bridge is absent. Listing is off over HTTP with
430
+ * auth `none`: every caller there resolves to the `default` tenant and so shares
431
+ * one canvas (#242). `ctx.tenantId` is `default` on stdio too, so the switch
432
+ * reads the transport.
426
433
  */
427
- export function initCanvasBridge(canvas) {
428
- _bridge = canvas ? new CanvasBridge(canvas) : undefined;
434
+ export function initCanvasBridge(canvas, config) {
435
+ _bridge = canvas
436
+ ? new CanvasBridge(canvas, {
437
+ listingEnabled: !(config.mcpTransportType === 'http' && config.mcpAuthMode === 'none'),
438
+ })
439
+ : undefined;
429
440
  }
430
441
  /** Return the canvas bridge, or `undefined` when canvas is unavailable. */
431
442
  export function getCanvasBridge() {
@@ -1 +1 @@
1
- {"version":3,"file":"canvas-bridge.js","sourceRoot":"","sources":["../../../src/services/canvas-bridge/canvas-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,EAIL,mBAAmB,GAEpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,E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G,CAAC,EAAE,CAAC,CAAC;IAC1F,CAAC;IAED;;;;OAIG;IACK,KAAK,CAAC,SAAS,CAAC,GAAY;QAClC,MAAM,IAAI,GAAa,EAAE,CAAC;QAC1B,IAAI,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC;YAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAClE,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC;YAAE,MAAM,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IACxD,CAAC;IAED,0EAA0E;IAClE,aAAa;QACnB,MAAM,IAAI,GAAG,WAAW,CAAC,oBAAoB,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAAC;QACrE,MAAM,KAAK,GAAG,WAAW,CAAC,oBAAoB,CAAC,CAAC,EAAE,kBAAkB,CAAC,CAAC;QACtE,OAAO,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;IAC/B,CAAC;CACF;AAED,IAAI,OAAiC,CAAC;AAEtC;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAC9B,MAA8B,EAC9B,MAA2D;IAE3D,OAAO,GAAG,MAAM;QACd,CAAC,CAAC,IAAI,YAAY,CAAC,MAAM,EAAE;YACvB,cAAc,EAAE,CAAC,CAAC,MAAM,CAAC,gBAAgB,KAAK,MAAM,IAAI,MAAM,CAAC,WAAW,KAAK,MAAM,CAAC;SACvF,CAAC;QACJ,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED,2EAA2E;AAC3E,MAAM,UAAU,eAAe;IAC7B,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -1,12 +1,8 @@
1
1
  /**
2
- * @fileoverview Bridge-layer SQL utilities. System-catalog denial is now
3
- * delegated to the framework via `QueryOptions.denySystemCatalogs` (added in
4
- * mcp-ts-core 0.10.4). `stripStringLiterals` is kept for the bridge's
5
- * `assertReferencedDataframesExist` pre-check, which scans for minted
6
- * `df_<id>` handles before handing off to the framework gate (#47).
7
- * `isSelectShaped` is used in the catch block to reclassify a
8
- * `non_select_statement` + UNKNOWN that is actually a column-not-found error
9
- * (#52).
2
+ * @fileoverview Bridge-layer SQL utility. System-catalog denial is delegated to
3
+ * the framework via `QueryOptions.denySystemCatalogs`; `stripStringLiterals`
4
+ * serves the bridge's `assertReferencedDataframesExist` pre-check, which scans
5
+ * for minted `df_<id>` handles before the framework gate runs (#47).
10
6
  * @module services/canvas-bridge/sql-gate-extras
11
7
  */
12
8
  /**
@@ -15,13 +11,4 @@
15
11
  * framework gate runs a real parser afterwards, this is a fast text gate.
16
12
  */
17
13
  export declare function stripStringLiterals(sql: string): string;
18
- /**
19
- * Return true when the SQL is SELECT-shaped: after stripping string literals
20
- * and SQL comments (-- line comments and block comments), the
21
- * statement starts with SELECT or WITH. Used to distinguish a column-not-found
22
- * prepare failure (the statement IS a SELECT — the framework gate assigns
23
- * UNKNOWN because the binder threw) from a legitimately non-SELECT statement
24
- * that the gate correctly rejects (#52).
25
- */
26
- export declare function isSelectShaped(sql: string): boolean;
27
14
  //# sourceMappingURL=sql-gate-extras.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sql-gate-extras.d.ts","sourceRoot":"","sources":["../../../src/services/canvas-bridge/sql-gate-extras.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEvD;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAKnD"}
1
+ {"version":3,"file":"sql-gate-extras.d.ts","sourceRoot":"","sources":["../../../src/services/canvas-bridge/sql-gate-extras.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEvD"}
@@ -1,12 +1,8 @@
1
1
  /**
2
- * @fileoverview Bridge-layer SQL utilities. System-catalog denial is now
3
- * delegated to the framework via `QueryOptions.denySystemCatalogs` (added in
4
- * mcp-ts-core 0.10.4). `stripStringLiterals` is kept for the bridge's
5
- * `assertReferencedDataframesExist` pre-check, which scans for minted
6
- * `df_<id>` handles before handing off to the framework gate (#47).
7
- * `isSelectShaped` is used in the catch block to reclassify a
8
- * `non_select_statement` + UNKNOWN that is actually a column-not-found error
9
- * (#52).
2
+ * @fileoverview Bridge-layer SQL utility. System-catalog denial is delegated to
3
+ * the framework via `QueryOptions.denySystemCatalogs`; `stripStringLiterals`
4
+ * serves the bridge's `assertReferencedDataframesExist` pre-check, which scans
5
+ * for minted `df_<id>` handles before the framework gate runs (#47).
10
6
  * @module services/canvas-bridge/sql-gate-extras
11
7
  */
12
8
  /**
@@ -17,18 +13,4 @@
17
13
  export function stripStringLiterals(sql) {
18
14
  return sql.replace(/'([^'\\]|\\.|'')*'/g, "''").replace(/"([^"\\]|\\.|"")*"/g, '""');
19
15
  }
20
- /**
21
- * Return true when the SQL is SELECT-shaped: after stripping string literals
22
- * and SQL comments (-- line comments and block comments), the
23
- * statement starts with SELECT or WITH. Used to distinguish a column-not-found
24
- * prepare failure (the statement IS a SELECT — the framework gate assigns
25
- * UNKNOWN because the binder threw) from a legitimately non-SELECT statement
26
- * that the gate correctly rejects (#52).
27
- */
28
- export function isSelectShaped(sql) {
29
- const stripped = stripStringLiterals(sql)
30
- .replace(/--[^\n]*/g, '')
31
- .replace(/\/\*[\s\S]*?\*\//g, '');
32
- return /^\s*(select|with)\b/i.test(stripped);
33
- }
34
16
  //# sourceMappingURL=sql-gate-extras.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sql-gate-extras.js","sourceRoot":"","sources":["../../../src/services/canvas-bridge/sql-gate-extras.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAW;IAC7C,OAAO,GAAG,CAAC,OAAO,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC;AACvF,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,cAAc,CAAC,GAAW;IACxC,MAAM,QAAQ,GAAG,mBAAmB,CAAC,GAAG,CAAC;SACtC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC;SACxB,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC,CAAC;IACpC,OAAO,sBAAsB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC/C,CAAC"}
1
+ {"version":3,"file":"sql-gate-extras.js","sourceRoot":"","sources":["../../../src/services/canvas-bridge/sql-gate-extras.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAW;IAC7C,OAAO,GAAG,CAAC,OAAO,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,qBAAqB,EAAE,IAAI,CAAC,CAAC;AACvF,CAAC"}
@@ -1,12 +1,15 @@
1
1
  /**
2
- * @fileoverview Static mapping of friendly financial concept names to XBRL tags.
2
+ * @fileoverview Static mapping of friendly financial concept names to XBRL tags,
3
+ * and the lookup every concept input goes through: a name or alias in any case or
4
+ * separator form, a camelCase spelling of one, a standard formula, or a raw tag.
3
5
  * @module services/edgar/concept-map
4
6
  */
5
7
  import type { ConceptMapping, ConceptTaxonomy, TagSelection } from './types.js';
6
8
  /**
7
- * Resolve a concept input to its mapping. Accepts friendly names in any case or
8
- * separator form (`Net Income`, `NET_INCOME`), with surrounding whitespace ignored.
9
- * Returns undefined if the input is not a known friendly name.
9
+ * Resolve a concept input to its mapping. Accepts a friendly name or alias in
10
+ * any case or separator form (`Net Income`, `NET_INCOME`, `capital_expenditures`)
11
+ * or split from camelCase (`operatingIncome`), with surrounding whitespace
12
+ * ignored. Returns undefined if the input names no catalog concept.
10
13
  */
11
14
  export declare function resolveConcept(input: string): ConceptMapping | undefined;
12
15
  /** A concept input that is neither a catalog name nor shaped like an XBRL element name. */
@@ -26,7 +29,7 @@ export interface UnknownConcept {
26
29
  export declare function unknownConceptHint(unknown: UnknownConcept): string;
27
30
  /**
28
31
  * Classify a concept input before any company resolution or SEC request.
29
- * Returns undefined for a catalog name (any case or separator form) and for
32
+ * Returns undefined for anything {@link resolveConcept} resolves and for
30
33
  * anything shaped like an XBRL element name — a well-formed tag the filer does
31
34
  * not report stays the tool's own no-data answer (#45). Everything else is
32
35
  * unknown, with its derivation or nearest catalog names (#128).
@@ -75,7 +78,8 @@ export interface ConceptEntry extends ConceptMapping {
75
78
  */
76
79
  export declare function listConcepts(): ConceptEntry[];
77
80
  /**
78
- * Search concepts by substring against friendly name, label, and XBRL tags.
81
+ * Search concepts by substring against friendly name, aliases, label, and XBRL
82
+ * tags. An alias is searched on its own: a label spelling `&` holds no `and`.
79
83
  * Passing a raw XBRL tag will reverse-lookup the friendly mapping(s).
80
84
  * Empty/whitespace query returns all entries.
81
85
  *
@@ -1 +1 @@
1
- {"version":3,"file":"concept-map.d.ts","sourceRoot":"","sources":["../../../src/services/edgar/concept-map.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAmiBhF;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,cAAc,GAAG,SAAS,CAExE;AAyDD,2FAA2F;AAC3F,MAAM,WAAW,cAAc;IAC7B,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,wFAAwF;IACxF,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,8FAA8F;IAC9F,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAYD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAIlE;AAED;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